Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hey all,
I have a dataset with tweets of all over the world. One visualization I have includes a map of locations of Tweets:
I can select based on city and what I want to do is to calculate the percentage of tweets from that country.
In DAX I now have: CALCULATE(COUNT('finalSet1-100927'[Country]) / CALCULATE(COUNTROWS('finalSet1-100927'); 'finalSet1-100927'[Country] <> "NA"))
NA is to filter out countries without a location. It calculates it perfectly:
But now when I select a city on my map, it automatically makes my selection to fit 100%:
While I would just want this to stay 0.9%. Is there any way this is possible?
Solved! Go to Solution.
@xadya,
Please check if the DAX below returns your expected result. If not, please share sample data of your original table.
Measure = CALCULATE(COUNT('finalSet1-100927'[Country]);ALLEXCEPT('finalSet1-100927';'finalSet1-100927'[Country])) / CALCULATE(COUNTROWS('finalSet1-100927'); 'finalSet1-100927'[Country] <> "NA";ALL('finalSet1-100927'))
Regards,
Lydia
@xadya,
Please check if the DAX below returns your expected result. If not, please share sample data of your original table.
Measure = CALCULATE(COUNT('finalSet1-100927'[Country]);ALLEXCEPT('finalSet1-100927';'finalSet1-100927'[Country])) / CALCULATE(COUNTROWS('finalSet1-100927'); 'finalSet1-100927'[Country] <> "NA";ALL('finalSet1-100927'))
Regards,
Lydia
Thanks a lot! I never thought about the ALLEXCEPT as a solution for this, but it makes sense!
User | Count |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |