Forum Discussion
Measures Power BI
Hi Aproksymacja
Can you please create measure
Measure =
VAR _LastMonthSales =
CALCULATE(
Sum(Table[Sales]),
PARALLELPERIOD(
'Calendar'[Transaction_Date],
-1,
MONTH
)
)
RETURN
% of Change Sale =
DIVIDE(
(Sum(Table[Sales])- _LastMonthSales),
_LastMonthSales,
BLANK()
)
Let me know if that works for you
If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.
Thanks
Pijush
Linkedin
Thank you for your solution, however I would like to see all the time comparison to Jan23, sice this will be my baseline. Also when I applied this solution January 23 dissaapeard, and I would like to keep it as 1.00 everywhere.
- PijushRoy2 years ago
Community Champion
Hi Aproksymacja
Can you please try in the above DAX, last line where BLANK(), please replace with 1Measure = VAR _LastMonthSales = CALCULATE( Sum(Table[Sales]), PARALLELPERIOD( 'Calendar'[Transaction_Date], -1, MONTH ) ) RETURN % of Change Sale = DIVIDE( (Sum(Table[Sales])- _LastMonthSales), _LastMonthSales, 1 )
Let me know
If your requirement is solved, please make THIS ANSWER as SOLUTION- Aproksymacja2 years agoNew Member
It helped for January, it is visible now, but calculations are not proper
In your solution 0.977(Jun) = Jun/May
I would like to have 0.94 (Jun) which is 164498412(Jun)/174792138(Jan)
- PijushRoy2 years ago
Community Champion
Hi Aproksymacja
Try thisMeasure = VAR _LastMonthSales = CALCULATE( Sum(Table[Sales]), PARALLELPERIOD( 'Calendar'[Transaction_Date], -1, MONTH ) ) RETURN % of Change Sale = If(ISBLANK(_LastMonthSales) || _LastMonthSales =0, 1, DIVIDE( (Sum(Table[Sales])- _LastMonthSales), _LastMonthSales, BLANK() )f your requirement is solved, please make THIS ANSWER as SOLUTION