Forum Discussion
sanjaymithran
4 months agoHelper II
Count Policy By Country
Hi All,
Need help for slicers, in country slicer should display Country (Count Policy) as mentionede below
| Country | Policy | Slicer | |
| US | 342 | Country | |
| US | 223 | US (8) | |
| US | 6745 | Malaysia (5) | |
| US | 343 | Singapore (4) | |
| US | 765 | ||
| US | 322 | ||
| US | 113 | ||
| US | 431 | ||
| Malaysia | 543 | ||
| Malaysia | 544 | ||
| Malaysia | 545 | ||
| Malaysia | 546 | ||
| Malaysia | 547 | ||
| Singapore | 623 | ||
| Singapore | 625 | ||
| Singapore | 627 | ||
| Singapore | 629 |
Hi sanjaymithran,
You can achieve it by adding a new column in the table with DAX
Country Display =PolicyData[Country] &" (" &CALCULATE(COUNT(PolicyData[Policy]),ALLEXCEPT(PolicyData, PolicyData[Country]))& ")"Attached is the example .pbix for you.๐ I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
๐ก Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
๐ As a proud SuperUser and Microsoft Partner, weโre here to empower your data journey and the Power BI Community at large.
๐ Curious to explore more? [Discover here].
Letโs keep building smarter solutions together!
2 Replies
- grazitti_sapnaSuper User
Hi sanjaymithran,
You can achieve it by adding a new column in the table with DAX
Country Display =PolicyData[Country] &" (" &CALCULATE(COUNT(PolicyData[Policy]),ALLEXCEPT(PolicyData, PolicyData[Country]))& ")"Attached is the example .pbix for you.๐ I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
๐ก Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
๐ As a proud SuperUser and Microsoft Partner, weโre here to empower your data journey and the Power BI Community at large.
๐ Curious to explore more? [Discover here].
Letโs keep building smarter solutions together! - Hans-Georg_PulsSuper User
Hi sanjaymithran ,
if I understand your setup right and your table has the two columns Country and Policy, the following steps should work:
- Define a measure: CountPolicies=DISTINCTCOUNT(Tablename[Policy])
- Add a table visual to your project
- Add Country as column to the table
- Add the measure as column to the table
Hope that helps you.