The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi Dax Guru's
How do I perform a dax measure to calculate the sum of the cost ones for each unique ID.
My current Dax formula: Total Cost = sum(cost) but the output is 1100 which is incorrect.
The correct output should show 600 only
See image below
Appreciate any input on this.
Did my research but could not find any solution that was close enough.
Solved! Go to Solution.
Hello @casperlow ,
if every project has just one value, you can use max with summarize:
yeah tried this it works on a table but not a on card. preferably works on both. the above solution worked but I had a filter for it to work.
It doesn't work when I tried this Dax on creating a measure, the error im gettings is "The end of the input was reached."
I had to tweak it a little for it to make it work on my table, I had to add a filter but overall the dax formula works. 🙂 thank you
hello @casperlow
is this what you are looking for?
create a new measure with following DAX.
Total Sum =
var _Cat = SELECTEDVALUE('Table'[Category])
Return
SUMX(
FILTER(
ALLSELECTED('Table'),
'Table'[Category]=_Cat
),
'Table'[Unit]
)
however, if you dont put a selection in slicer, it will become blank.
While put them into table will show all the value.
Hope this will help.
Thank you.
Hello @casperlow ,
if every project has just one value, you can use max with summarize:
User | Count |
---|---|
16 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
13 | |
13 | |
8 | |
8 |