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.
I am trying to create a compare to previous period report, and having some issues with a measure to calculate amounts based on the previous periods.
Very simple dashboard with one slicer on it. The slicer is for the Fiscal Period (ex. 202301, 202302, 202303 etc). users can select multiple periods to see the selected periods amounts. I would then like to do a measure to get the previous period amounts, like this:
Solved! Go to Solution.
Hi @powerbi1980 ,
Based on your description, I have created a simple sample:
Please try:
Previous Period Amount =
var _a = SELECTCOLUMNS('DimPeriod',"Period",[Period]-100)
return CALCULATE(SUM(FactGL[DisplayAmount]),FILTER(ALL(DimPeriod),VALUE('DimPeriod'[Period]) IN _a))
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @powerbi1980 ,
Based on your description, I have created a simple sample:
Please try:
Previous Period Amount =
var _a = SELECTCOLUMNS('DimPeriod',"Period",[Period]-100)
return CALCULATE(SUM(FactGL[DisplayAmount]),FILTER(ALL(DimPeriod),VALUE('DimPeriod'[Period]) IN _a))
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@powerbi1980 , what is basis of previous perdio month of year. Make sure you are using date table and slicer, measure and visual are using field from date table
you can have measure like
example
Month behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
You want select and compare
How to use two Date/Period slicers
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
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 |
---|---|
113 | |
100 | |
77 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |