Forum Discussion
Doorian
1 year agoNew Member
DAX Measure
Hello everyone, I am looking for help regarding a DAX measure in a matrix visual. I want to calculate the change of my initial measure (number of trips per day) compared to the previous month. In my ...
- 1 year ago
You can try
Month on Month change = IF ( ISINSCOPE ( 'Date'[Year month] ), VAR CurrentValue = [Num trips] VAR PrevValue = CALCULATE ( [Num trips], DATEADD ( 'Date'[Date], -1, MONTH ) ) VAR Result = CurrentValue - PrevValue RETURN Result, VAR MinDate = MINX ( ALLSELECTED ( 'Date'[Year month sort column] ), 'Date'[Year month sort column] ) VAR MaxDate = MAXX ( ALLSELECTED ( 'Date'[Year month sort column] ), 'Date'[Year month sort column] ) VAR CurrentValue = CALCULATE ( [Num trips], 'Date'[Year month sort column] = MaxDate ) VAR PrevValue = CALCULATE ( [Num trips], 'Date'[Year month sort column] = MinDate ) VAR Result = CurrentValue - PrevValue RETURN Result )Its important to use the column which year month is sorted by, rather than the year month column itself, as MIN / MAX won't work properly with alphanumeric columns. If your year month column is actually date which is just formatted in year month format then you can use that column.
v-venuppu
1 year agoCommunity Support
Hi Doorian ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you johnt75 for the prompt response.
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.