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
calen
Helper I
Helper I

Help with Totaling

Hello All! 

 

I've got what I feel is a very simple problem but I can't quite figure out how to fix it. Below is a sample Dataset. I am trying to take the normal price - the discount price, then multiply that by the units sold to get the total discount. When I have it in a table, it works. When I put it in a card, the numbers go crazy. I am using the two measures below. What I want is a card that totals the "Total Discount" column which would be $6,765. What I am getting is $182,951 (the sum of discounts - $12 x total units - 15,246). Please help!

 

Unit Price - Discount =
SUM([Unit Price]) - AVERAGE([Discount Price])
 
Total Discount =
[Unit Price - Discount] * SUM([Quantity])

 

 

Item Average Unit Price Discount PriceUnit Price - Discount Quantity Total Discount
1 $                     15.00 $             14.00 $                         1.00               210 $              210
2 $                     20.00 $             19.00 $                         1.00            2,077 $           2,077
3 $                     19.00 $             18.00 $                         1.00            3,280 $           3,280
4 $                     10.00 $             10.00 $                              -              7,411 $                 -  
5 $                     23.00 $             22.00 $                         1.00                 35 $                35
6 $                     21.00 $             21.00 $                              -                 309 $                 -  
7 $                     24.00 $             23.00 $                         1.00                 85 $                85
8 $                     40.00 $             39.00 $                         1.00            1,003 $           1,003
9 $                     46.00 $             46.00 $                              -                 802 $                 -  
10 $                     66.00 $             62.00 $                         4.00                   4 $                15
11 $                     54.00 $             52.00 $                         2.00                 30 $                59
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@calen , I think it should be like

 

Discount Amount =

SUMX(Table, ([Unit Price] - [Discount Price])*[Quantity])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@calen , I think it should be like

 

Discount Amount =

SUMX(Table, ([Unit Price] - [Discount Price])*[Quantity])

@amitchandak Thank you for your help! The unit price comes from the item table, the discount price comes from the pricing table table, and the quantity comes from the sales table.  Is there a way to bring all three tables into the measure above?

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.