Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all
I am trying to sum only distinct values for the column "units" where the combination is the same for month+code+city
As seen for example:
In the image above it should only sum 35,661 once.
I tried this dax but unsuccesful result:
Sum RE distinct =
SUMX(
SUMMARIZE(Sheet1,Sheet1[Code],Sheet1[City],Sheet1[Month]),
MAX(Sheet1[Units])
)
Result should be:
https://1drv.ms/u/s!ApgeWwGTKtFdhyxvwe8MeK5wIhZ0?e=CfKDy4
How can I get it right?
Thanks.
Solved! Go to Solution.
@o59393 , a new measure
sumx(summarize(Table,Table[month],Table[code],Table[city],Table[unit]),[unit])
or your formula like
Sum RE distinct =
SUMX(
SUMMARIZE(Sheet1,Sheet1[Code],Sheet1[City],Sheet1[Month],"_1",MAX(Sheet1[Units])),
[_1]
)
@o59393 , a new measure
sumx(summarize(Table,Table[month],Table[code],Table[city],Table[unit]),[unit])
or your formula like
Sum RE distinct =
SUMX(
SUMMARIZE(Sheet1,Sheet1[Code],Sheet1[City],Sheet1[Month],"_1",MAX(Sheet1[Units])),
[_1]
)
Can some one explain why this works?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 66 | |
| 44 | |
| 40 | |
| 29 | |
| 19 |
| User | Count |
|---|---|
| 200 | |
| 126 | |
| 103 | |
| 70 | |
| 53 |