cancel
Showing results for 
Search instead for 
Did you mean: 
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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors