Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi, I'm trying to create a DAX for this expression (examples below):
If [DATE] from a column falls between 3/1/24 and 2/28/25, then FY2024, if [DATE] from the same column falls between 3/1/23 and 2/29/24, then FY2023
Solved! Go to Solution.
Thanks for the reply from @nandic , allow me to provide additional information on your comments based on the user's data.
Hi,@DMB90
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2. Below are the Calculated Columns I've created for your needs:
date check =
SWITCH(TRUE(),'Table'[1.Cteated Date]>=DATE(2024,3,1)&&'Table'[1.Cteated Date]<=DATE(2025,2,28),"FY2024",
'Table'[1.Cteated Date]>=DATE(2023,3,1)&&'Table'[1.Cteated Date]<=DATE(2024,2,29),"FY2023",
BLANK())
3.Here's my final result, which I hope meets your requirements.
4.Here are some related documents to help you:
Tutorial: Create your own measures in Power BI Desktop - Power BI | Microsoft Learn
Tutorial: Create calculated columns in Power BI Desktop - Power BI | Microsoft Learn
Also, I've attached my pbix file so you have the option to get it in time if you need it.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is my date column that I want to check against specified date ranges. I'm not sure how to check my date range against this date column below.
Thanks for the reply from @nandic , allow me to provide additional information on your comments based on the user's data.
Hi,@DMB90
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2. Below are the Calculated Columns I've created for your needs:
date check =
SWITCH(TRUE(),'Table'[1.Cteated Date]>=DATE(2024,3,1)&&'Table'[1.Cteated Date]<=DATE(2025,2,28),"FY2024",
'Table'[1.Cteated Date]>=DATE(2023,3,1)&&'Table'[1.Cteated Date]<=DATE(2024,2,29),"FY2023",
BLANK())
3.Here's my final result, which I hope meets your requirements.
4.Here are some related documents to help you:
Tutorial: Create your own measures in Power BI Desktop - Power BI | Microsoft Learn
Tutorial: Create calculated columns in Power BI Desktop - Power BI | Microsoft Learn
Also, I've attached my pbix file so you have the option to get it in time if you need it.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
13 | |
12 | |
10 | |
7 | |
7 |
User | Count |
---|---|
19 | |
14 | |
11 | |
10 | |
10 |