Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello
Here's one Im stuck with. I have 2 stores, each service people with different Citizen codes. I want to be able to COUNT the number of times that citizen code appears in a list, but without hard coding EACH of the citizen codes. (the list is extensive, snapshot below)
At present I have a measure for each citizen code // AUS = CALCULATE ( COUNTROWS (Sheet1),Sheet1[Citizen]="AUS") // but this means I need to create a measure for each citizen code individually, and the lists can grow regularly so its hard to keep up.
Is there a way that I can the system to recoginze the unique citizen code values in the list, then count those unique values, but without having to create individual measure for each citizen code?
| Shop | Date | Citizen |
| PX1 | 4/5/2016 | AUS |
| PX2 | 4/5/2016 | AUS |
| PX1 | 4/6/2016 | AUS |
| PX2 | 4/6/2016 | AUS |
| PX2 | 4/6/2016 | AUS |
| PX1 | 4/6/2016 | AUS |
| PX1 | 4/6/2016 | AUS |
| PX2 | 4/9/2016 | AUT |
| PX1 | 4/9/2016 | AUT |
| PX2 | 4/9/2016 | DEU |
| PX2 | 4/9/2016 | DEU |
| PX1 | 4/9/2016 | DEU |
| PX1 | 4/9/2016 | DEU |
| PX2 | 4/9/2016 | DEU |
| PX1 | 4/9/2016 | DEU |
| PX2 | 4/10/2016 | DEU |
| PX2 | 4/10/2016 | DEU |
| PX1 | 4/10/2016 | DEU |
| PX1 | 4/11/2016 | NOR |
| PX2 | 4/11/2016 | NOR |
| PX1 | 4/11/2016 | NOK |
| PX2 | 4/11/2016 | NOK |
| PX2 | 4/11/2016 | DEU |
| PX1 | 4/11/2016 | CHL |
| PX1 | 4/11/2016 | DEU |
| PX1 | 4/12/2016 | DEU |
| PX1 | 4/12/2016 | GBR |
Solved! Go to Solution.
Measure = CALCULATE ( COUNTROWS('Table'), ALLEXCEPT('Table', 'Table'[Citizen]) )Yes the above will give OVERALL Total at the Citizen level no matter what - useful for calculating % at the Citizen level (NOT Grand Total)
Yes if you'll use Slicers just use Total = COUNTROWS(Table) with no filters!
Hope this helps and makes sense! ![]()
Measure = CALCULATE ( COUNTROWS('Table'), ALLEXCEPT('Table', 'Table'[Citizen]) )Yes the above will give OVERALL Total at the Citizen level no matter what - useful for calculating % at the Citizen level (NOT Grand Total)
Yes if you'll use Slicers just use Total = COUNTROWS(Table) with no filters!
Hope this helps and makes sense! ![]()
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 33 | |
| 31 | |
| 29 |