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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Memorable Member
Memorable Member

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

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.