Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello Team,
How to bring previous year/month value based on current FY filter.
Refer the below snap for reference.
Please help here.
Solved! Go to Solution.
Hi @Anonymous ,
You can create calendar table first of all, then create relationship between your data table and calendar table on date field.
Calendar = CALENDAR(MIN(Table1[Date]),MAX(Table1[Date])) Or Calendar =CALENDARAUTO()
Secondly, you may create measure to get previous year/month value using DAX below.
Measure1= CALCULATE(SUM(Table1[Sales]),DATEADD('Calendar'[Date],-12,MONTH))
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
You can create calendar table first of all, then create relationship between your data table and calendar table on date field.
Calendar = CALENDAR(MIN(Table1[Date]),MAX(Table1[Date])) Or Calendar =CALENDARAUTO()
Secondly, you may create measure to get previous year/month value using DAX below.
Measure1= CALCULATE(SUM(Table1[Sales]),DATEADD('Calendar'[Date],-12,MONTH))
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Your first step is to use Power Query to reshape your data so that the year/month becomes a row value instead of a column header
Code | Name | Year/Month | Value
If you use a date for year/month then you can use something like the techniques described in this post https://radacad.com/previous-dynamic-period-dax-calculation
It's a step further, but you might think about adding a Calendar Table and creating a relationship to your fact table. That way if you are missing data for a year/month it will still show up in your reports. You can google Calendar Table and find many ways to make one. They are exremely useful in DAX
Help when you know. Ask when you don't!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
99 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |