Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Dear all,
I have a column in my table which i want to be summed on a unique row, but it needs to ignore the 'code' column. So when summing instantly it returns 10. but I need it to be two, since City is changing as well, but this needs to be taken into account.
ID | TYPE | Code | City | Type_ID | Year | Sum |
A | R! | 625 | NY | R1-A | 2023 | 1 |
A | R! | 545 | NY | R1-A | 2023 | 1 |
A | R! | 126 | NY | R1-A | 2023 | 1 |
A | R! | 120 | NY | R1-A | 2023 | 1 |
A | R! | 116 | NY | R1-A | 2023 | 1 |
A | R! | 625 | LA | R1-A | 2023 | 1 |
A | R! | 545 | LA | R1-A | 2023 | 1 |
A | R! | 126 | LA | R1-A | 2023 | 1 |
A | R! | 120 | LA | R1-A | 2023 | 1 |
A | R! | 116 | LA | R1-A | 2023 | 1 |
Solved! Go to Solution.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a measure as below.
Sum =
COUNTROWS(
SUMMARIZE(
'Table',
'Table'[ID],
'Table'[City]
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a measure as below.
Sum =
COUNTROWS(
SUMMARIZE(
'Table',
'Table'[ID],
'Table'[City]
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , is it not, distinct count of the city ?
a new measure
distinctcount(Table[City])
the result is 2 yes, but lets say my table in real is much longer with different ID in same city
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |