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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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