Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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: Location
Main location | Within 3km |
AAA | BBB |
AAA | BBB |
BBB | CCC |
Table 2: POI
Location | POI | Category |
BBB | LV | Luxury |
BBB | GAP | Fashion |
BBB | Kids | Kids |
Solved! Go to Solution.
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.
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.
@kbandito - Maybe:
Measure =
VAR __Search = MAX(Location[Within 3km])
RETURN
COUNTROWS(FILTER('POI',[Location]=__Search))
Or
Measure =
VAR __Search = MAX(Location[Within 3km])
RETURN
COUNTROWS(DISTINCT(SELECTCOLUMNS(FILTER('POI',[Location]=__Search),"brands",[Category])))
Otherwise, please provide additional details.
Hi, the first measures kinda works, but i think the MAX function limits it to show only 1 location.
For example, AAA will have 5 locations in the Within 3km list. Now the measure is only showing the POI count for just 1 location, i will need it to show POI count for all 5 locations when AAA is selected.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.