Forum Discussion

kbandito's avatar
kbandito
Frequent Visitor
6 years ago
Solved

DAX to count based on another column

Hi, I am looking for a DAX to count the number of brands available in BBB when I selected AAA. I need a DAX because i need to build charts that can breakdown the count by category.   Table 1: Loca...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi kbandito ,

     

    You can try to create a measure and put it into a card. When you select AAA, the card returns the number of brands 3 km away from you.

    Count =
    CALCULATE (
        COUNTROWS ( 'POI' ),
        FILTER (
            'POI',
            [Location]
                = CALCULATE (
                    MAX ( 'Location'[Within 3km] ),
                    FILTER (
                        'Location',
                        [Main location] = SELECTEDVALUE ( Location[Main location] )
                    )
                )
        )
    )

     

    You can check more details from here.

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.