The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
User | Count |
---|---|
65 | |
62 | |
60 | |
53 | |
28 |
User | Count |
---|---|
181 | |
82 | |
67 | |
47 | |
44 |