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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Show the top n value that is not affected by the slicer

I am trying to show the 1st provider in the area based on the stock_numbers in the map that is filtered by slicer to any of the providers available. For example, in slicer I select the provider "A" which owns 10 units in Leicester.

Now I want to see which provider is first in the area and how much stock they own. In my example, this would be provider B with 40 units. However, I can't make the measure to ignore the slicer, because it will still return provider "A" with 10 units.

I managed to make this happen outside of the map, where I disabled the interactions with the slicer. However, as soon as I try to include it in the map and use ALL function in the measure, it won't work as desired.

Here are the formulas that will work when the interactions with slicer are disabled:

For Top provider in the area:

 

topn2 = TOPN(
    1,
    VALUES(group_structure[provider_or_group_name]),
    CALCULATE(
        SUM(owned_stock[stock_numbers])),
        DESC
)

 

For number of units they own:

 

Measure = MAXX(
    SUMMARIZE(group_structure,group_structure[provider_or_group_name],
    "Amount",
    SUM(owned_stock[stock_numbers])),
    [Amount])

 

This is what I tried to ignore the slicer:

For Top provider in the area:

 

top1 = TOPN(
    1,
    VALUES(group_structure[provider_or_group_name]),
    CALCULATE(SUM(owned_stock[stock_numbers]), ALL(group_structure[provider_or_group_name])),
    DESC)

 

For Stock number of units they own (this I coulnd't figure out to work):

 

Measure 2 = MAXX(
    SUMMARIZE(group_structure,
    group_structure[provider_or_group_name],
    "Amount",
        CALCULATE(SUM(owned_stock[stock_numbers]),
        ALL(group_structure[provider_or_group_name])),
    [Amount]))

 

Sample data here (please note that in my case, the calcuation works with 2 tables, as some providers belong to a group):

 

providerlocationtype_of_stockstock_numbers
ALondon110
ALondon230
AManchester120
ALeicester15
ALeicester25
BLondon120
BLondon25
BManchester15
BLeicester120
BLeicester220

 

1 REPLY 1
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can try to clear the filter of the table with "ALL (table)".

If it doesn't work, Please provide sample data of the two tables involved in your measure and show the result you want with image(Please mask any sensitive data before uploading.)

 

Best Regards,

Liang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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