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

Sum on different number ranges and conditions

I have two tables:

 

Tab1:

RowNumberCnt_FromCnt_ToType
102040004200MB
102043004550MB
102046504800MB
1030

5000

5300

MB
103053806000MB
200010201030B
104060106080MB
104060906120MB
105061306180MB
210010401080B
220020002100B
    
    

 

Tab2:

CntAmount

4000

350

4100300
410012
4250345
5000324
5100554
6100234
6120543
6150234

 

MB is the type for a Sub-group: = sum[Amount] the range in Cnt_from ... Cnt_to in Tab2[Cnt]

B is the type for a Super-group range in RowNumber: = sum the sum for each row of the RowNumbers

 

Result shall be:

 

RowNumberSumExplanantion
10201007sum the amount in Tab2 for Cnt in range 4000 … 4800
1030878sum the amount in Tab2 for Cnt in range 5000 … 6000
20001885sum the sum for RowNumbers in range 1020 … 1030
1040777sum the amount in Tab2 for Cnt in range 6010 … 6120
1050234sum the amount in Tab2 for Cnt in range 6030 … 6180
21001011sum the sum for RowNumbers in range 1040 … 1080
22002896

sum the sum for RowNumbers in range 2000 … 2100

 

I am looking forward for any hint how to solve this problem.... 

2 REPLIES 2
Fowmy
Super User
Super User

@uic46079 

The last line is the grand total it seems and it adds up the sub total. Do have a different Type value for grand total? 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

No, it´s the summarize of the row numbers 2000 up to 2100

in that case the rownumber 2000 is as well a summarized value of the rownumbers 1020 and 1030 and that is the sum of the cnt 4000 ... 4800 plus sum of the cnt 5000 ... 6000 

Means:
2000 = 1020 + 1030 = sum(4000 ... 4800) + sum(5000 ... 6000)

2100 = 1040 + 1080 = sum(6010 ... 6020) + sum(6130 ... 6180)

2200 = 2000 + 2100 = 1020 + 1030 + 1040 + 1080 = sum(4000 ... 4800) + sum(5000 ... 6000) + sum(6010 ... 6020) + sum(6130 ... 6180)

 

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.

Top Solution Authors