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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
hueuro
Frequent Visitor

MOM VAR%

hueuro_0-1712291935299.png

HOW CAN I MAKE DAX FORMULA FOR MOM% IF THE CM IS HIGHER VALUE SHOULD BE POSITIVE.but mom i put abs with PM but still some exp getting positive (eg selling exp) when i remove abs mom2 see the total coming -ve.it should be positive

 

MOM = IFERROR( ([CM 2]-[PM])/ABS([PM]),"")

MOM2 = IFERROR( ([CM 2]-[PM])/([PM]),"")

Please help how can i get current variance%

4 REPLIES 4
johnbasha33
Super User
Super User

@hueuro MOM_Variance =
VAR MoM = ([CM 2] - [PM]) / ABS([PM])
RETURN
IF(
[CM 2] >= [PM], -- Check if CM is higher than or equal to PM
MoM, -- If CM is higher, return MoM as is
-MoM -- If CM is lower, return the negative of MoM
)

hi 

i make like this its working but still one error in yoy%

MOM% =
VAR CM = SUM(Query1[Amount1])
VAR PM = CALCULATE([Net Profit 2], PREVIOUSMONTH(Query1[Posting Date]))
RETURN
IF(
    ISBLANK(CM) || ISBLANK(PM),
    BLANK(),
    IF(
        AND(
            NOT(ISBLANK(CM)),
            NOT(ISBLANK(PM))
        ),
        IF(
            [CM] > [PM],
            (CM - PM) / PM,
            -(PM - CM) / PM
        )
    )
)
 
for yoy am getting some of the data 
 
hueuro_0-1712938524887.png

 

BeaBF
Super User
Super User

@hueuro Hi! Try:

MoM% =
VAR CurrentMonth = [CM 2]
VAR PreviousMonth = [PM]
VAR Variance = CurrentMonth - PreviousMonth
RETURN
IF(
Variance >= 0,
DIVIDE(Variance, PreviousMonth),
- DIVIDE(Variance, PreviousMonth)
)

BBF

hueuro
Frequent Visitor

hi 

i make like this its working but still one error in yoy%

MOM% =
VAR CM = SUM(Query1[Amount1])
VAR PM = CALCULATE([Net Profit 2], PREVIOUSMONTH(Query1[Posting Date]))
RETURN
IF(
    ISBLANK(CM) || ISBLANK(PM),
    BLANK(),
    IF(
        AND(
            NOT(ISBLANK(CM)),
            NOT(ISBLANK(PM))
        ),
        IF(
            [CM] > [PM],
            (CM - PM) / PM,
            -(PM - CM) / PM
        )
    )
)
 
for yoy am getting some of the data 
 
hueuro_1-1712938564242.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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