Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next 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

Reply
Lauraeire_81
Helper I
Helper I

Count duplicates in particular category

Hi

I want to count the duplicates for specific categories selected in a slicer. The Countries should be displayed in the slicer.

 

If America is chosen in the slicer, is there any way to create a calculated column of '3' for the Hot dogs value?

 

For example see the below table:

CountriesFood
AmericaHot dogs
AmericaCorn dogs
AmericaBigmacs
Ireland Stew
Ireland Cabbage and bacon
AmericaHot dogs
AmericaHot dogs 

 

Thanks in advance, 

Laura

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @Lauraeire_81  - Yes, you can achieve it both calculated column or measure too. suggest to use measure as like below:

 

 

rajendraongole1_0-1744810095051.png

Food Count by Country =
CALCULATE(
    COUNTROWS('test'),
    ALLEXCEPT('test', 'test'[Food]),
    'test'[Countries] IN VALUES('test'[Countries])
)
 
Hope this helps.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

v-nmadadi-msft
Community Support
Community Support

Hi @Lauraeire_81,
Thanks for reaching out to the Microsoft fabric community forum.

The measure provided by @rajendraongole1  pretty much helps to do the count you are looking for

Sharing reference articles for the dax function used in the measure for further reading and uploading sample pbix where i tried out the measure for reference
COUNTROWS function (DAX) - DAX | Microsoft Learn

ALLEXCEPT function (DAX) - DAX | Microsoft Learn


If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards

View solution in original post

3 REPLIES 3
v-nmadadi-msft
Community Support
Community Support

Hi @Lauraeire_81,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

 

v-nmadadi-msft
Community Support
Community Support

Hi @Lauraeire_81,
Thanks for reaching out to the Microsoft fabric community forum.

The measure provided by @rajendraongole1  pretty much helps to do the count you are looking for

Sharing reference articles for the dax function used in the measure for further reading and uploading sample pbix where i tried out the measure for reference
COUNTROWS function (DAX) - DAX | Microsoft Learn

ALLEXCEPT function (DAX) - DAX | Microsoft Learn


If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards

rajendraongole1
Super User
Super User

Hi @Lauraeire_81  - Yes, you can achieve it both calculated column or measure too. suggest to use measure as like below:

 

 

rajendraongole1_0-1744810095051.png

Food Count by Country =
CALCULATE(
    COUNTROWS('test'),
    ALLEXCEPT('test', 'test'[Food]),
    'test'[Countries] IN VALUES('test'[Countries])
)
 
Hope this helps.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.