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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
CloudMonkey
Post Prodigy
Post Prodigy

Identifying relevant local markets

Hi,

 

I'm working for a company that define the local market of a branch/shop as all local authorities that represent at least 80% of customers.

 

For the below examples:

1. if a branch has one local authority giving 67%, another giving 12% and a third giving 8% then all other local authorities can be ignored because 80% has been identified.

2. if a branch has one local authority giving 70% and three local authorities giving 8% then all 4 local authorities should be included because it was a tie for second place.

 

Please can you tell me how to identify the relevant local authorities using a calculated measure? I'm trying to avoid using a calculated column so that the user can change the time periods using a slicer.

 

identifying relevant local markets.JPG

 

Thanks for any pointers,

 

CM

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @CloudMonkey ,

 

One sample for your reference. Here I created two calculated columns to work on it. Please notice I modified your data a bit to make the logic more reasonable.

 

INT = 
VAR total =
    CALCULATE (
        SUM ( [%of customers] ),
        FILTER (
            Table1,
            Table1[Branch Number] = EARLIER ( Table1[Branch Number] )
                && Table1[Local AN] <= EARLIER ( Table1[Local AN] )
        )
    )
VAR no =
    INT ( total * 10 )
RETURN
    no
Result = 
VAR cou =
    CALCULATE (
        COUNTROWS ( Table1 ),
        FILTER (
            Table1,
            Table1[Branch Number] = EARLIER ( Table1[Branch Number] )
                && Table1[Local AN] <= EARLIER ( Table1[Local AN] )
                && Table1[INT] = 8
        )
    )
RETURN
    IF ( Table1[INT] <= 8 && cou <> 2, 1, 0 )

Capture.PNG

 

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @CloudMonkey ,

 

One sample for your reference. Here I created two calculated columns to work on it. Please notice I modified your data a bit to make the logic more reasonable.

 

INT = 
VAR total =
    CALCULATE (
        SUM ( [%of customers] ),
        FILTER (
            Table1,
            Table1[Branch Number] = EARLIER ( Table1[Branch Number] )
                && Table1[Local AN] <= EARLIER ( Table1[Local AN] )
        )
    )
VAR no =
    INT ( total * 10 )
RETURN
    no
Result = 
VAR cou =
    CALCULATE (
        COUNTROWS ( Table1 ),
        FILTER (
            Table1,
            Table1[Branch Number] = EARLIER ( Table1[Branch Number] )
                && Table1[Local AN] <= EARLIER ( Table1[Local AN] )
                && Table1[INT] = 8
        )
    )
RETURN
    IF ( Table1[INT] <= 8 && cou <> 2, 1, 0 )

Capture.PNG

 

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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