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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Get correct sum of a measure in table

I have a measure that is not showing the correct total in the table. This measure is created from other measures and those measures are created using more measures.  

Extract Loss = MeasureB - MeasureA

dpibarker_0-1686697968289.png

How do I get the total to be accurate?

or what I really want is to show the "percent of grand total" - which should be -598.66 / -1708.58 = 35.04%.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I got it working by using this:

SUMX(
   GROUPBY(Table, Table[Column], Table[Column2]),
    Measure1 - Measure2
)

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I got it working by using this:

SUMX(
   GROUPBY(Table, Table[Column], Table[Column2]),
    Measure1 - Measure2
)
amitchandak
Super User
Super User

@Anonymous , it should work, Using the columns/field in visual

 

New M1= Sumx(summarize(Table, Table[Column], "_1",[MeasureB] - [MeasureA]) , [_1])

 

 

for % fo total  = divide([New M1], calculate([New M1]), allselected()) )

Anonymous
Not applicable

what is "_1" for? 

 

Here is what I tried and it did not work:

Extract Loss total by group =
VAR m1 =
    SUMX (
        SUMMARIZE (
            Table,
            Table[Location],
            Table[Brand],
            Table[ItemNo],
            "_1", [Theoretical] - [Actual]
        ),
        [_1]
    )
RETURN
    DIVIDE ( m1, CALCULATE ( m1, ALLSELECTED () ) )

 When I add this to my table, every row shows 100%

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.