Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi Everyone 😊
I'm trying to create a Rolling Month field in DAX with a condition. Note: the examples below are the screenshots from Excel to show what output I want to get in Power BI. Hope it is clear 🙂
The conditon is described below:
When the field Aligned is filtered to No, then the Rolling Month is calculated for each country for the most current available month. It is shown below:
When field is filtered to "Yes" then it is aligning all fields to the month where Sales are available and calculating month accordingly. You may see below an example:
I also attached the PBIX file, where you can check details:
Any help much appreciated, thank you!
Link to the PBIX file is here:
https://drive.google.com/drive/folders/1CGU2XIhiC2K2kWd9984tTxbWmX3G42uA?usp=share_link
Regards,
Matias
Solved! Go to Solution.
Hi @maatiash
You can create a mesure:
Rolling month = "M"&COUNTROWS(FILTER(ALLSELECTED(CountryData),[Country]=MAX([Country])&&MONTH(CountryData[Reporting Date])>=MONTH(MAX([Reporting Date]))))
and set the following filter in visual filter:
Output:
.
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @maatiash
You can create a mesure:
Rolling month = "M"&COUNTROWS(FILTER(ALLSELECTED(CountryData),[Country]=MAX([Country])&&MONTH(CountryData[Reporting Date])>=MONTH(MAX([Reporting Date]))))
and set the following filter in visual filter:
Output:
.
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Yolo,
Thank you for your help! Please let me to test, so I'll let you know if it works 🙂
Thanks and Regards,
Matias
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
26 | |
20 | |
18 | |
14 | |
13 |
User | Count |
---|---|
43 | |
36 | |
24 | |
22 | |
21 |