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.
Hi, I am trying to calculate the following:
Measure
DistinctQuantity = CALCULATE(DISTINCTcount([Id]),[IsActive]="Active")
Measure
TotalPrice= DistinctQuantity*sum(Price)
Price DistinctQuantity TotalPrice
A 10 1 10
B 0 100 0
C 0 899 0
Total 10 1000 10000
Solved! Go to Solution.
In this scenario, you TotalPrice should be eavaluated on each row level, so you should use SUMX() function.
Total Price = SUMX(Table3,Table3[Price]*[Total Quantity])
Regards,
In this scenario, you TotalPrice should be eavaluated on each row level, so you should use SUMX() function.
Total Price = SUMX(Table3,Table3[Price]*[Total Quantity])
Regards,
In general, consider that the total line is really the measure evaluated in the context of ALL. You can add a if HASONEFILTER to your measure to calculate it for rows with the alternative being your calculation for your total row. I may have those reversed. It's early.