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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
Solution Sage
Solution Sage

@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
Impactful Individual
Impactful Individual

@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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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