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
wildrose2023
Frequent Visitor

MROUND issue on matrix subtotals and totals

Hi guys,

 

I have an issue that drives me crazy. I'm using a complex formula that uses SUMX and also USERELATIONSHIP in order to achieve my final measure, that produces the output like in column 1 in my screenshot. Now when I do the MROUND on that calculation it does the MROUND on every level, so I get the output of column 3 while I need the output of column 2:

 

wildrose2023_0-1706717920808.png

So instead of the MROUND to round 744 to 745 I need it to sum the rounded values of the levels bellow (375+170+105+75+25 = 750).

 

Can you let me know what could be the issue?

The Price measure I'm using is the one bellow, and the base measure is just a simple sum:

Price =
Var _Calc =
SUMX(
    DimIssue,
    CALCULATE(
        SWITCH(
                TRUE(),
                SELECTEDVALUE(DimIssue[BillingDateName]) = "DueDate", [Price - DueDate],
                SELECTEDVALUE(DimIssue[BillingDateName]) = "StartDate", [Price - StartDate],
                SELECTEDVALUE(DimIssue[BillingDateName]) = "SentDate", [Price - SentDate],
                SELECTEDVALUE(DimIssue[BillingDateName]) = "GoogleDate", [Price - Google],
                [Price - CreatedDate])
                ))

Var _Result =
MROUND(_Calc,5)

RETURN
_Calc

Base measure: 
SUM(FactWorklogs[FinalPrice])
I'm using the matrix visual and of course the subtotals and totals are off. They are not the sum of the rounded sums, but the sum of regular values with the MROUND applied last.

Any suggestions appreciated
1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @wildrose2023 ,

 

I created some data:

vyangliumsft_0-1706753181356.png

 

Here are the steps you can follow:

1. Create measure.

Test =
IF(
    ISINSCOPE('DimIssue'[Account]),[Price],ROUND(SUMX(VALUES('DimIssue'[Account]),[Price]),-1))

2. Result:

vyangliumsft_1-1706753181360.png

 

Best Regards,

Liu Yang

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

View solution in original post

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @wildrose2023 ,

 

I created some data:

vyangliumsft_0-1706753181356.png

 

Here are the steps you can follow:

1. Create measure.

Test =
IF(
    ISINSCOPE('DimIssue'[Account]),[Price],ROUND(SUMX(VALUES('DimIssue'[Account]),[Price]),-1))

2. Result:

vyangliumsft_1-1706753181360.png

 

Best Regards,

Liu Yang

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

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