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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
sperry
Resolver I
Resolver I

should I use a dax filter or visual filter

I have a real simple question - I have a model that focusses on outcomes by ethnicity. I have in the past created measures that filter by ethnicity (only have 3 options, total, Indian descent and non- Indian descent) should I do this in DAX or apply filters to the measures?

2 ACCEPTED SOLUTIONS
dedelman_clng
Community Champion
Community Champion

Hi @sperry -

 

In my opinion, hard-coding should be avoided whenever possible. The beauty of PowerBI is that as long as you don't hard code measures (or visual/page/report filters), it automatically scales if you find yourself with more choices than you originally had. I would use ethnicity as a dimension and put it in "Legend" wherever possible on a visual, or as a column for table/matrix.  Then your measures will automatically have the filter applied.

 

If this doesn't work for you, please provide a pbix or sample data/model structure so we can see your individual case.

 

Hope this helps

David

View solution in original post

amitchandak
Super User
Super User

@sperry , A Slicer, or visual/page filter is better as it filters out the data. It filters for all measures (unless they ignore slicer value) .

In case of measure, if you two-measure those need filters. Both measures need to have this filter. So better to have a slicer/filter in such a case.

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@sperry , A Slicer, or visual/page filter is better as it filters out the data. It filters for all measures (unless they ignore slicer value) .

In case of measure, if you two-measure those need filters. Both measures need to have this filter. So better to have a slicer/filter in such a case.

dedelman_clng
Community Champion
Community Champion

Hi @sperry -

 

In my opinion, hard-coding should be avoided whenever possible. The beauty of PowerBI is that as long as you don't hard code measures (or visual/page/report filters), it automatically scales if you find yourself with more choices than you originally had. I would use ethnicity as a dimension and put it in "Legend" wherever possible on a visual, or as a column for table/matrix.  Then your measures will automatically have the filter applied.

 

If this doesn't work for you, please provide a pbix or sample data/model structure so we can see your individual case.

 

Hope this helps

David

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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