cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
tonijj Member
Member

Re: Compare Data within the same table

@v-shex-msft

 

Thanks for the response! 

 

I tried adding the "Hostname" as well, the remaining issue is that the Totals are not correct. I have found the issue; The formula for "Diff MOM" does not add a variance per hostname level when drilling down, which means that the Total is incorrect. See attached pictures.

 

At first I thought it had to do with "Allselected" and changed it to use the "All" formula, but that didnt do it. 

 

Any ideas for this last step? 

 

Thanks again, I really do appreciate the help!

 

Volumes wrong1.pngVolumes wrong2.png

Community Support Team
Community Support Team

Re: Compare Data within the same table

Hi @tonijj,

 

It seems like I only add 'host name' filter on previous total variable,now I add it to current total variable, maybe you can try ot use following formula if it fix the issue.

MOM Diff =
VAR currDate =
    MAX ( DateTable[DateKey] )
VAR currTotal =
    CALCULATE (
        SUM ( DetailedVolumes[Volume] ),
        FILTER (
            ALLSELECTED ( DetailedVolumes ),
            MONTH ( [DateKey] ) = MONTH ( currDate )
        ),
        VALUES ( Services[SIN] ),
        VALUES ( Service[Host Name] )
    )
VAR prevTotal =
    CALCULATE (
        SUM ( DetailedVolumes[Volume] ),
        FILTER (
            ALLSELECTED ( DetailedVolumes ),
            MONTH ( [DateKey] )
                = MONTH ( currDate ) - 1
        ),
        VALUES ( Services[SIN] ),
        VALUES ( Service[Host Name] )
    )
RETURN
    IF ( prevtotal <> BLANK (), currTotal - prevTotal )

BTW, 'all' function will ignore other filter effects, so I use 'allselected' function to instead.(it can also break current row contents filter but not ignore other filters)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
tonijj Member
Member

Re: Compare Data within the same table

@v-shex-msft

 

Hi, 

 

I actually did try to add that line to the formula, but it didnt work. Well, except for that the "hostname" is in the table "Detailedvolume". In any case, I get the same result, it leaves the "MOM Diff" blank even though there is a difference, but only on hostname level. 

 

If the formula would calculate on that level as well Im pretty sure the Totals would be fine. Any other suggestions?

 

Ps. Of course youre right about the "ALL" function, thanks for the explanation, think I was just too tired when I tried that out last week Smiley Happy Appreciate the explanation!

Community Support Team
Community Support Team

Re: Compare Data within the same table

Hi @tonijj,

 

Yes, measure with specific filters has some trouble to calculate on total level, maybe you can take a look at following blog which told about hierarchy level handling.

Clever Hierarchy Handling in DAX

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 66 members 1,162 guests
Please welcome our newest community members: