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.
Hi,
I made a measure that calculates the% change between the previous month, quarter, year.
% Change Units =
VAR CurrentValue = 'Sales Ths Units'[Total Sales Units]
VAR PreviousValue =
SWITCH(
TRUE(),
ISINSCOPE('Timedimension'[Date].[Day]), CALCULATE('Sales Ths Units'[Total Sales Units], DATEADD('Timedimension'[Date], -1, DAY)),
ISINSCOPE('Timedimension'[Date].[Month]), CALCULATE('Sales Ths Units'[Total Sales Units], DATEADD('Timedimension'[Date], -1, MONTH)),
ISINSCOPE('Timedimension'[Date].[Quarter]), CALCULATE('Sales Ths Units'[Total Sales Units], DATEADD('Timedimension'[Date], -1, QUARTER)),
ISINSCOPE('Timedimension'[Date].[Year]), CALCULATE('Sales Ths Units'[Total Sales Units], DATEADD('Timedimension'[Date], -1, YEAR))
)
RETURN
DIVIDE(
CurrentValue - PreviousValue,
PreviousValue)
It work when I use on a graph automatic date hierarchy from PowerBi.
Now I have to add another hierarchy with date on the graph (I cant use date hierarchy from PowerBI):
When I added this hierarchy my value : "% Change Units" is blank on the graph.
How I can fix it? Thanks!
Hi @paulinamaj ,
I guess your measure doesnt contain the hierarchy you added in,that's why you see blank results.You need to add the hierarchy in your measure.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
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 |
---|---|
96 | |
95 | |
82 | |
71 | |
64 |
User | Count |
---|---|
115 | |
105 | |
95 | |
79 | |
72 |