How to implement day month and year function using DAX in power bi

This recipe helps you implement day month and year function using DAX in power bi

Recipe Objective - How to implement Day, Month, and Year function using DAX in Power BI?

Task - Create 3 new columns as Day, Month, and Year of order date using superstore dataset.

Step 1 - Open Power BI report

Step 2 - New Column

Go to Fields pane -> Right-click on Dataset -> New column

Step 3 - Dax query(Day function)

Write down the formula as Day = Day([Order-date])

This will create a new column as 'Day,' containing the Day of all order dates.

Build a Multi Touch Attribution Model in Python with Source Code

Step 4 - New Column

Step 5 - Dax query(Month function)

Write down the formula as Month = Month([Order-date])

This will create a new column as 'Month,' containing the Month of all order dates.

Step 6 - New Column

Step 7 - Dax query(Year function)

Write down the formula as Year = Year([Order-date])

This will create a new column as 'Year,' containing the Year of all order dates.

In this way, we can use Day, Month, and Year functions in Power BI.

What Users are saying..

profile image

Abhinav Agarwal

Graduate Student at Northwestern University
linkedin profile url

I come from Northwestern University, which is ranked 9th in the US. Although the high-quality academics at school taught me all the basics I needed, obtaining practical experience was a challenge.... Read More

Relevant Projects

A/B Testing Approach for Comparing Performance of ML Models
The objective of this project is to compare the performance of BERT and DistilBERT models for building an efficient Question and Answering system. Using A/B testing approach, we explore the effectiveness and efficiency of both models and determine which one is better suited for Q&A tasks.

Build a Hybrid Recommender System in Python using LightFM
In this Recommender System project, you will build a hybrid recommender system in Python using LightFM .

Build OCR from Scratch Python using YOLO and Tesseract
In this deep learning project, you will learn how to build your custom OCR (optical character recognition) from scratch by using Google Tesseract and YOLO to read the text from any images.

MLOps using Azure Devops to Deploy a Classification Model
In this MLOps Azure project, you will learn how to deploy a classification machine learning model to predict the customer's license status on Azure through scalable CI/CD ML pipelines.

Loan Eligibility Prediction in Python using H2O.ai
In this loan prediction project you will build predictive models in Python using H2O.ai to predict if an applicant is able to repay the loan or not.

Build a Credit Default Risk Prediction Model with LightGBM
In this Machine Learning Project, you will build a classification model for default prediction with LightGBM.

Build an Image Classifier for Plant Species Identification
In this machine learning project, we will use binary leaf images and extracted features, including shape, margin, and texture to accurately identify plant species using different benchmark classification techniques.

Build an AI Chatbot from Scratch using Keras Sequential Model
In this NLP Project, you will learn how to build an AI Chatbot from Scratch using Keras Sequential Model.

Learn to Build a Neural network from Scratch using NumPy
In this deep learning project, you will learn to build a neural network from scratch using NumPy

Classification Projects on Machine Learning for Beginners - 2
Learn to implement various ensemble techniques to predict license status for a given business.