Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 22 | |
| 10 | |
| 10 | |
| 6 | |
| 5 |