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.
Guys,
I'm really desperate!!
Can't seem to find the right solution for this problem. I would be very much apreciated if any of you can help me.
My table has sales records with and without discount percentage. I want to multiply unit by quantity if disc equals to 100
Something like this:
Solved! Go to Solution.
The measure you wrote will sum the entire of each column, then multiply.
What you really want, is to go row by row and multiply, then sum the result.
This is filter vs row context. You need a row iterator, which is SUMX.
A | B |
1 | 1 |
2 | 2 |
3 | 3 |
For the above example,
Filter Context = Sum(A) * Sum(B) = (1+2+3) * (1+2+3) = 6 * 6 = 36
Row Context = SUMX (table, A * B) = (1*1) + (2*2) + (3*3) = 1 + 4 + 6 =15
So, your code should be:
GrossOffered = SUMX(FILTER('Table','Table'[Disc]=100), 'Table'[Un Price] * Table'[Qty] )
Love hearing about Power BI tips, jobs and news?
I love to share about these - connect with me!
Stay up to date on
Read my blogs on
Did I answer your question? Mark my post as a solution! Proud to be a Super User!
Connect with me!
Stay up to date on
Read my blogs on
The measure you wrote will sum the entire of each column, then multiply.
What you really want, is to go row by row and multiply, then sum the result.
This is filter vs row context. You need a row iterator, which is SUMX.
A | B |
1 | 1 |
2 | 2 |
3 | 3 |
For the above example,
Filter Context = Sum(A) * Sum(B) = (1+2+3) * (1+2+3) = 6 * 6 = 36
Row Context = SUMX (table, A * B) = (1*1) + (2*2) + (3*3) = 1 + 4 + 6 =15
So, your code should be:
GrossOffered = SUMX(FILTER('Table','Table'[Disc]=100), 'Table'[Un Price] * Table'[Qty] )
Love hearing about Power BI tips, jobs and news?
I love to share about these - connect with me!
Stay up to date on
Read my blogs on
Did I answer your question? Mark my post as a solution! Proud to be a Super User!
Connect with me!
Stay up to date on
Read my blogs on
Hey Steve, somehow when the qty is bigger than 1 it doesn't multiply correctly....but the totals and subtotals are correct. Do you know how to fix this?
Hey Steve
Thank you so much. It works perfectly!!!! Awesome!!!
Best regards
Pedro
You should create a new column and multiply unit price and Qty. Sum(price)*sum(Qty) does not seem right to me
There use IF
IF(disc=100,unitPrice*qty)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |