Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Thanks for any pointers,
CM
Solved! Go to Solution.
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 )
Pbix as attached.
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 )
Pbix as attached.
User | Count |
---|---|
77 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
100 | |
93 | |
52 | |
50 | |
48 |