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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors