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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
andrewb95
Helper II
Helper II

Count the number of cases a specific value is shown from a measure

I have two tables both are showing the ID and longitude and latitude for a specific item. One table shows this for a home address and another shows this for a specific store. 

 

I have then used https://stackoverflow.com/questions/27928/calculate-distance-between-two-latitude-longitude-points-h... to plot the distance between each point in a measure. 

 

powerbi_upload2.PNG

I want to calculate the count of  Sub ID's which have an value beneath 80. As you can see I have added conditional formatting to show this at the moment. 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @andrewb95 ,

Sorry for replying late. Based on your description, you can create this measure to count:

Count = 
COUNTX (
    FILTER (
        SUMMARIZE (
            ALL ( 'Table' ),
            'Table'[TenantId],
            'Table'[Customer ID],
            'Table'[Store ID],
            "Re", [Measure]      //your measure to calculate the sub
        ),
        [Re] < 80
    ),
    [Re]
)

re.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yingjl
Community Support
Community Support

Hi @andrewb95 ,

Sorry for replying late. Based on your description, you can create this measure to count:

Count = 
COUNTX (
    FILTER (
        SUMMARIZE (
            ALL ( 'Table' ),
            'Table'[TenantId],
            'Table'[Customer ID],
            'Table'[Store ID],
            "Re", [Measure]      //your measure to calculate the sub
        ),
        [Re] < 80
    ),
    [Re]
)

re.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@andrewb95 , Try a measure like

 

countx(filter(summarize(Table, table[tenant_id], table[Store_id], "_1",[Distance measure]),[_1]>80),[tenant_id])

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors