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 guys,
I'm working with a matrix, and I conted the number of whipment splitted by Area (rows) and year-month (columns).
I'd like to add one more column, but I fond some issues when I try to create the new measure.
My idea is to create a column that shows the % of variation in comparison with the last n months (let's say 2 month).
So, for example, the measure for March for the 2° row will make this calculation:
Average(13:16) [average of 2° row monhts January and February]
/
24 [value of 2° row for March]
Do you have any idea to help me?
Thank you very much!!
Solved! Go to Solution.
Hi @pasno ,
1.Create a calendar table.
Calendar =
ADDCOLUMNS (
CALENDAR ( MIN ( 'Table'[Date] ), MAX ( 'Table'[Date] ) ),
"YearMonth",
YEAR ( [Date] ) & "-"
& MONTH ( [Date] )
)
2.Create a What-if parameter and put it into a slicer.
3.Create this measure.
Percentage =
DIVIDE (
DIVIDE (
CALCULATE (
SUM ( 'Table'[Value] ),
DATESINPERIOD ( 'Calendar'[Date], LASTDATE ( 'Table'[Date] ), -3, MONTH )
)
- SUM ( 'Table'[Value] ),
[Parameter Value]
),
SUM ( 'Table'[Value] )
)
You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @pasno ,
1.Create a calendar table.
Calendar =
ADDCOLUMNS (
CALENDAR ( MIN ( 'Table'[Date] ), MAX ( 'Table'[Date] ) ),
"YearMonth",
YEAR ( [Date] ) & "-"
& MONTH ( [Date] )
)
2.Create a What-if parameter and put it into a slicer.
3.Create this measure.
Percentage =
DIVIDE (
DIVIDE (
CALCULATE (
SUM ( 'Table'[Value] ),
DATESINPERIOD ( 'Calendar'[Date], LASTDATE ( 'Table'[Date] ), -3, MONTH )
)
- SUM ( 'Table'[Value] ),
[Parameter Value]
),
SUM ( 'Table'[Value] )
)
You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@pasno ,
For Week vs Week please refer
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
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 |
---|---|
107 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |