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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
vmlb
Regular Visitor

Value Filters on Orders with Multiple Lines

Hey guys,

I'm a newbie and I'd really appreciate some help. I have an Orders Table and there's a column called Discount (that refers to the discount offered for the whole order) and this value is repeated in all of that order's lines. Ex


Order No | Product | Value | Discount
1              | A            | 30     | $ 10
1              | B            | 500    | $ 10
1              | C            | 50     | $ 10
2              | A            | 30     | $ 20
2              | B            | 500    | $ 20

As you can see, in order 1 there are 3 different items, but order 1 had a total Discount of only $ 10, not $ 30. When I use Average, it works fine for each order, but as for the total, the result I wanted was $ 10 (first order) + $ 20 (second order) = $ 30 (total discount), but I get the $ 18, which is the average for the Discount field. 

I Also tried it with Max and, again, it works fine for each order, but fails to show me the Total I wanted. 

How should I approach this problem?

 

Thank you very much in advance.

3 REPLIES 3
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @vmlb,

 

 

Could you please mark the proper answers as solutions?

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @vmlb,

 

How about creating a discount table like below?

Order No  |   Discount

1               |     10

2               |     20

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

 

Drag Order to the row labels and write this measure

 

Discount=IF(HASONEVALUE(Data[Order No]),MIN(Data[Discount]),SUMX(SUMMARIZE(VALUES(Data[Order No]),[Order No],"ABCD",MIN(Data[Discount])),[ABCD]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.