Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
mclawler
Helper II
Helper II

MoM % Variance

Hi Everybody, first post, I am a rookie at this stuff and for the life of me can't seem to figure out the correct DAX for MoM % Variance.  I'm self-taught and done pretty well so far, but I must be missing something simple and making a rookie mistake on this one.  All I am trying to achieve, is to show how much the Balance went up(or down) from one month to the next.  I'm sure I am way over-thinking it, logic tells me I need to use the sum of Balance filtered by the Month(date) and divide that by the sum of balance for previous month.  Please advise, and thank you this forum has been by far my most valuable resource thus far. 

 

mclawler_0-1675900956804.png

I have more detailed tables as well, but for this specific visual I am literally only using this table I created for summary and simplicity

mclawler_1-1675901219354.png

 

mclawler_0-1675902454871.png

 

 

5 REPLIES 5
mclawler
Helper II
Helper II

Figured it out with the builtin Quick Measure suggestions, I thought since it was showing me an error it wasn't working, but the calculations appear to be correct regardless of the error.  Thanks everyone 

 

Exposure Balance MoM% =
IF(
    ISFILTERED('Exposure Balance Monthly'[Snapshot Month]),
    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
    VAR __PREV_MONTH =
        CALCULATE(
            SUM('Exposure Balance Monthly'[Exposure Balance]),
            DATEADD('Exposure Balance Monthly'[Snapshot Month].[Date], -1, MONTH)
        )
    RETURN
        DIVIDE(
            SUM('Exposure Balance Monthly'[Exposure Balance]) - __PREV_MONTH,
            __PREV_MONTH
        )
)
 
mclawler_0-1675978998261.png

 

v-xinruzhu-msft
Community Support
Community Support

Hi @mclawler 

You can reger to the following measure

 

MTM% = var a=SUMX(FILTER(ALLSELECTED('Table'),EOMONTH('Table'[Snapshot month],0)=EOMONTH(MAX('Table'[Snapshot month]),1)),[Exposure Balance])
return DIVIDE(a-SUM('Table'[Exposure Balance]),SUM('Table'[Exposure Balance]))

 

vxinruzhumsft_0-1675913094711.png

 

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Your DAX did exactly as your chart shows, however I don't think it's giving me the results I'm looking for.  

 

For example -

from 2/1/2022 to 3/1/2022 I'm looking for a -50%

from 3/1/2022 to 4/1/2022 I'm looking for 39.6%

from 4/1/2022 to 5/1/2022 I'm looking for 0%

from 5/1/2022 to 6/1/2022 I'm looking for 497%

 

Current month divided by previous month for the increase/decrease %

 

Thank you! 

 

 

 

wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1675911299616.png

 

The results you got are what I'm after! But when I unput the DAX 2 different ways I get 2 different errors, please advise what I'm doing incorrectly:

 

mclawler_0-1675959771352.png

mclawler_1-1675959844260.png

 

Thank you! 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors