Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I will explain very simply. I have two tables with relationship "Model"
Table_A:
Table_B:
My table visual shows me total price = unit price * model count, which is calculated correct. But the grand total for all devices is too high. I think here's something wrong with HASONEFILTER expression
My total price formula:
CALCULATE(SUM('Price'[Price]) * COUNTA('Model'[Model name]))
Here's sample data screenshot
I couldnt upload image, so I am putting link here - https://ibb.co/HCtdzXP
Hi, @Salauat , you may try this measure,
Total price =
SUMX (
DISTINCT ( 'Table_B'[Model] ),
CALCULATE ( COUNTROWS ( 'Table_A' ) * MAX ( 'Table_B'[Unit Price] ) )
)
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@Salauat Your columns are coming from different tables, show how they are connected, it would be great if you can attach a sample file.
@Salauat try using HASONEVALUE instead. You can refer the following link which solves the measure totals problem:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Did I solve your problem?
If yes, then please mark my answer Accepted!
@Anonymous I have tried your solution, but it is not working for me, maybe I typed incorrect formula.
Can you please write a formula for me?
@Salauat , you need to summarize the Measure you have created. The calculated measure for correct total will be as follows:
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |