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

Filter/no Filter for specific entry between two tables

I have 2 tables, in the first table (T_FACT_RevCost) are departments and financial figures, in the second one are the departments (T_DIM_Department). The tables are 1-* linked together. Selecting a department in T_DIM_Department should filter the T_FACT_RevCost - except for the "special" departments HR and Controlling, they should see everything in the FACT table. If I select HR or Controlling in the visual, the filter should be removed. And no, choosing nothing in the visual is not an option

 

T_Department

DepartmentNoFilter
Controlling1
HR1
Dep10
Dep20
Dep30
Dep40

 

T_FACT_RevCost

DepartmentRevCostPeriod
Controlling1052021-07-01
HR20152021-07-01
Dep130252021-07-01
Dep240352021-07-01
Dep350452021-07-01
Dep460552021-07-01
Controlling1052021-08-01
HR21162021-08-01
Dep131172021-08-01
Dep241222021-08-01
Dep351322021-08-01
Dep452422021-08-01

 

Filter.PNG

 

FilterVisuals.PNG

Should display all departments / values

 

 

File: 

Filter_Test.pbix – OneDrive (live.com)

 

Help is really appreciated

Toddy

2 REPLIES 2
Anonymous
Not applicable

Just create a separate table with departments that you'll put in the slicer as above (it'll be a disconnected table) and keep in there the (hidden) field DepartmentSlicer[NoFilter]. Once you have this, create a measure that will return 1 if  1) the currently visible department (this time you'll drag the department from the T_Department onto the visual) - you can use ISINSCOPE to check for the currently visible department - is the one selected in the slicer and at the same time NoFilter for it is 0, or 2) if NoFilter is 1 for the currently selected value in the slicer. This logical condition codes the behaviour you want for your rows. Then use the measure to filter the rows in your visual using the Filter Pane.

 

Of course, there are other ways to do it. You could create a table that would store the mappings between FromDepartmentID and ToDepartmentID. It would be a factless fact table. The FromDepartmentName would be exposed, so that it could be put on the slicer. Depending on your model and requirements, you could/should delete the T_Department table. The mapping table would be connected to your fact either directly (many-to-many) or via a (hidden) T_Department table. This all depends on the requirements. Then, you'd slice by FromDepartment and it would work the way you want thanks to the mapping table.

 

It would be much easier to demonstrate... but I don't have time (yet).

 

However, you should never forget that your models should never allow RI violations. If you neglect to ensure it, you'll be in trouble sooner or later.

Anonymous
Not applicable

Thanks for your reply. I will try idea no 1.

I'll come back on this after my vacation

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.

Top Solution Authors