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.
Hello
I want to calculate the sum of a column that contains values from Measures based on criteria.
I have data like:
Customer1, MeasureResult1
Customer1, MeasureResult2
Customer2, MeasureResult3
I want to calculate the sum per customer, i.e.
Customer1, (MeasureResult1 + MeasureResult2)
Customer2, MeasureResult3
The problem is that the MeasureResults are not available when PowerBI autocompletes formulas.
Any idea?
Thanks
Solved! Go to Solution.
Hi @Anonymous ,
You can try something like the measure below:
measure = SUMX(SUMMARIZE(TABLE,TABLE[Customer],"a",[MeasureResult]),a)
It will be nice if you can show us some sample data if possible.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @Anonymous ,
You can try something like the measure below:
measure = SUMX(SUMMARIZE(TABLE,TABLE[Customer],"a",[MeasureResult]),a)
It will be nice if you can show us some sample data if possible.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
@Anonymous ,
Please share some data input and expected result for better understanding.
@Anonymous , Not very clear. But something like that
sumx(Summarize(Table,Table[customer], "_1",
switch( true(),
max(Table1[customer]) = "Customer 1" ,[Measure 1]+[Measure 2],
max(Table1[customer]) = "Customer 2" ,[Measure 2]
)) ,[_1])
Also refer if this can help
https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/