cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
qubit813
Post Patron
Post Patron

how to cross-filter other visuals by top N + others visual

I have a pie chart that shows a "top N + others" very similar to the solution as described below.  (See the Dropbox file posted by @jdbuchanan71 .)

https://community.powerbi.com/t5/Desktop/Pie-Chart-Top-5-Rest-named-Other/m-p/737504#M355623

 

The essential part of that solution is to create a dummy table that contains the distinct values of the dimension used in the "top N" (e.g., the 'Companies' table created from the 'Transacties' table) as well as an "Others" row.

 

I want a selection in visuals containing the "top N + others" measures to "drive" (i.e., cross-filter) all other visuals.  The problem is that the 'Companies' table is disconnected from the data model (in particular, the 'Transacties' table).  So, I need to figure out how to create a virtual relationship between the 'Companies' table and the 'Transacties' table.  In particular, the cross-filtering needs to run from the 'Companies' table to the 'Transacties' table.  (Currently, the cross-filtering works from the 'Transacties' table to the 'Companies' table, because of the virtual relationship in the "top N" measures.)

 

So, say that I had another pie chart that is sliced by 'Transacties'[Company], with a measure like:

2018 Total Amount =
CALCULATE(
    SUM('Transacties'[Amount])
    ,'Date'[Year] = 2018
)

 

What do I need to do to this measure (or some other solution) to make this pie chart filter according to the values selected in the "Top 5 + Other by Company" pie chart (since that pie chart contains 'Companies'[Company])?

 

I have tried the following, but it isn't correct:
2018 Total Amount =
CALCULATE(
    SUM('Transacties'[Amount])
    ,'Date'[Year] = 2018

    ,TREATAS(

        VALUES('Companies')

        ,'Transacties'[Company]

    )
)

2 REPLIES 2
amitchandak
Super User IV
Super User IV

@qubit813 , when say top of other visuals, I assume companies are selected and based on the current filter what are the companies should be used by other visuals (Top 5 from that).

Can you share sample data and sample output in a table format?



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

@amitchandak 

 

Actually, I can do you one better...  Below is the link to the pbix file:

https://www.dropbox.com/s/tocvgtmsqpwxneg/Top%205%20Other.pbix?dl=0

 

(Again, the above file isn't mine.  It was created by @jdbuchanan71 .)

 

As it currently stands, the visuals that have 'Transacties'.[Company] cross-filter the visuals that have 'Companies'.[Company].  My goal is to also have cross-filtering run in the opposite direction.  That is, not only should the cross-filtering be done this direction, but it should also cross-filter from 'Companies'.[Company] to 'Transacties'.[Company].  So, for example, the top right pie chart should cross-filter the bottom-left pie chart.

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors