Forum Discussion

Lauraeire_81's avatar
Lauraeire_81
Icon for Helper I rankHelper I
1 year ago
Solved

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 ...
  • rajendraongole1's avatar
    1 year ago

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

     

     

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

     

  • Anonymous's avatar
    Anonymous
    1 year ago

    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