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
sam466113
New Member

Sum of distinct values

Hi all,

I am new PowerBi and exploring various options.

 

Please find below the data table. Table name is "Table1"

 

NameOrder NumberSub OrderOrder AmountReceipt NumberSub Receipt NumberAmount
A123110456132
A123110789132
A123220456232
A123220789232
B852125753160
B852230753260
C852115894117

 

I am tryting to create a calculation that will give below given values:

- If I select Name =A in filter or Order Number = 123 in filter then it should give total as 30 (based on column Order Amount)

 and other calulation that will give Sum of Amount as 32 (based on column Amount)

 

- If I select Name = B or Order Number = 852 on the filter then it should give total as 55 (Based on Column Order Amount)

and  other calulation that will give Sum of Amount as 60 (based on column Amount)

 

If i remove all filter then Sum of Order Number should be 100 

and sum of Amount should be 109.

 

Can someone please help me here with these 2 calculations.

 

Thanks in advance.

Sam

1 REPLY 1
lbendlin
Super User
Super User

Learn about the usage of SUMMARIZE or SUMMARIZECOLUMNS.  In your case the grouping must include the Sub Order column and use MAX aggregation for the Order Amount.  

lbendlin_0-1679844386982.png

 

 

It is also not recommended to mix orders and receipts this way - these are independent facts.

 

 

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.