The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
All -
I'm working with a invoice detail report and am trying to calculate the total invoice amount if/when I isolate a single line item. The output I'm currently seeing is that the result is multiplied by the times something is repeated within a specific line item.
Here is an example:
Invoice Number | Product code | Amount |
inv 123 | prod 1 | 100 |
inv 123 | prod 2 | 250 |
inv 123 | prod 3 | 200 |
inv 123 | prod 2 | 250 |
inv 123 | prod 2 | 250 |
inv 123 | prod 4 | 150 |
Total | 1200 |
THe current error I find is that when I search for prod 2, the total amount returned is 3600. The total amount of 1200 is counted 3 times due to prod 2 repeating.
The desired outcome is when i filter/search for invoices containing prod 2, it should be 1200 in this single instance
Solved! Go to Solution.
Hi @Anonymous ,
Based on my test, you could create below measure:
Total amount = CALCULATE(SUM(Table1[Amount]),ALL(Table1))
Result:
You could also download the pbix file to have a view.
Regards,
Daniel He
Hi @Anonymous ,
Waht is your desired result? If I select Prod 2, it will show 750:
Regards,
Daniel He
Hi @Anonymous ,
Based on my test, you could create below measure:
Total amount = CALCULATE(SUM(Table1[Amount]),ALL(Table1))
Result:
You could also download the pbix file to have a view.
Regards,
Daniel He
Hi,
Shouldn't the result e 250*3=750?
User | Count |
---|---|
74 | |
70 | |
39 | |
30 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
48 | |
46 |