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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Get a total sum of a measure

Dear All,

 

I tried to fix a sum of a measure in a row total, even with tips and tricks from the forum here, but unfortunately without result. Therefore a next attempt for my own situation.

 

I have created the following measure, but the total is not the sum of the total of the rows. 

 

Any help is welcome to get this solved.

 

Thanks!

---------------------------------------

 

MEASURE:

 

Due Fee New =
IF (
    SUM([number of rows]) = 0,
    " ",
SUMX(
   VALUES('Dim Customer'[Customer name]),
IF(
    (0.70 - (VAR this_Unique =
    SUM ( [number of rows] )
VAR group_unique =
    CALCULATE (
        SUM ( [number of rows] ),
        ALL ( 'Dim Time'[Hour Period] )
    )
RETURN
    DIVIDE ( this_unique, group_unique )))*100*1.14*21 < 0, "", (0.70 - (VAR this_Unique =
    SUM ( [number of rows] )
VAR group_unique =
    CALCULATE (
        SUM ( [number of rows] ),
        ALL ( 'Dim Time'[Hour Period] )
    )
RETURN
    DIVIDE ( this_unique, group_unique )))*100*1.14*21)))
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.

 

Also, sample data would help greatly. Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Anonymous This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.

 

Also, sample data would help greatly. Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks Greg for your feedback.

 

Herewith a data set in text:

 

Table_Customer:

 

Customer numberCustomer name
1000ABC
1001BCD
1002CDE

 

Table_Orders

Number of rowsCustomer numberCustomer nameOrder numberHour period
41000ABC10160714:00 – 15:00
11000ABC10206014:00 – 15:00
41000ABC10306114:00 – 15:00
11000ABC10340011:00 – 12:00
11000ABC10423516:00 – 17:00
41000ABC135641308:00 – 09:00
941000ABC135642010:00 – 11:00
11001BCD10207414:00 – 15:00
11001BCD10209314:00 – 15:00
11001BCD10314011:00 – 12:00
11001BCD10428816:00 – 17:00
171001BCD140276709:00 – 10:00
211001BCD140276909:00 – 10:00
561001BCD140280210:00 – 11:00
141001BCD140308012:00 – 13:00
141001BCD140487417:00 – 18:00
81001BCD140487617:00 – 18:00
251001BCD140519709:00 – 10:00
21001BCD140520309:00 – 10:00
61001BCD140540712:00 – 13:00
71001BCD140541712:00 – 13:00
791001BCD140551112:00 – 13:00
321001BCD140555412:00 – 13:00
441001BCD140582515:00 – 16:00
111001BCD140584915:00 – 16:00
311001BCD140613617:00 – 18:00
101001BCD140614717:00 – 18:00
91002CDE140831616:00 – 17:00
191002CDE140897612:00 – 13:00
21002CDE140942316:00 – 17:00
291002CDE141010712:00 – 13:00
31002CDE141866516:00 – 17:00
291002CDE141936512:00 – 13:00
41002CDE141976816:00 – 17:00
141002CDE142050012:00 – 13:00
21002CDE142085216:00 – 17:00
21002CDE143190316:00 – 17:00
121002CDE143258312:00 – 13:00
91002CDE143312517:00 – 18:00
21002CDE144008416:00 – 17:00
161002CDE144148417:00 – 18:00

 

I hope this helps for a next step in the solution. Once the formula is rewritten, I wil, check the total sum

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors