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
varelapablo90
Helper II
Helper II

Filter table by Measure not working

Hello community

 

I am trying to build a report that per default should be empty.

The table should get populated with the data only after the mandatory slicers contain a selection. (PD_CO_CODE and PD_VENDOR)

 

For this I have created 2 measures

Check_Filter_CoCode = ISFILTERED('table'[PD_CO_CODE]) // Returns true when CoCode is Filtered  
Check_Filter_Vendor = ISFILTERED('table'[PD_VENDOR]) // Returns true when Vendor is Filtered  
 
 And then another Measure that check if both of these measures are True it should return a 1.
Hide Visual = IF([Check_Filter_CoCode] = TRUE() && [Check_Filter_Vendor] = TRUE(),1,0)
 
I filter my table by the measure Hide Visual = 1 but it still shows information although the measures are calculating ok.
 
Do you know what is going wrong here? what could be an alternative to solve this issue and get the desired result?
 
Thank you 

varelapablo90_1-1690475031298.png

 

 

1 ACCEPTED SOLUTION
JasonC_XBI
Advocate II
Advocate II

G'Day,

The solution you have attempted is based on the technique described in the Show/Hide Excelerator BI Blog post.

The issue you are having is that your logic is testing a column that is being used in the table visual you are attempting to hide.  Therefore, it is selffulfilling the Check_Filter_CoCode requirement.

 

If you need this column in the visual, then you will need to use a duplicate proxy column in the slicer.

For example, if this is a column being used in a relationship, you could use ISFILTERED('table'[PD_CO_CODE]), but then in the visual plot 'fact tble'[PD_CO_CODE]

 

Alternatively, you could possibly use a SELECTEDVALUE measure on your table visual, then the value will only appear in the visual when a single selection in the slicer has been made.

It depends if you were intending to force single selection on the slicer.

 

Hope this helps, and Good luck!

View solution in original post

4 REPLIES 4
JasonC_XBI
Advocate II
Advocate II

G'Day,

The solution you have attempted is based on the technique described in the Show/Hide Excelerator BI Blog post.

The issue you are having is that your logic is testing a column that is being used in the table visual you are attempting to hide.  Therefore, it is selffulfilling the Check_Filter_CoCode requirement.

 

If you need this column in the visual, then you will need to use a duplicate proxy column in the slicer.

For example, if this is a column being used in a relationship, you could use ISFILTERED('table'[PD_CO_CODE]), but then in the visual plot 'fact tble'[PD_CO_CODE]

 

Alternatively, you could possibly use a SELECTEDVALUE measure on your table visual, then the value will only appear in the visual when a single selection in the slicer has been made.

It depends if you were intending to force single selection on the slicer.

 

Hope this helps, and Good luck!

Sorry, I'm green hand , I wonder know how to use the selectedvalue measure on this table visual so it will only appear in the visual  when a single selection in the slicer has been made,Thank you so much🙏

Thank you 🙂

flath
Helper II
Helper II

Hi!

What you can do is to implement the checking into the measures you want to show values only when the filters are applied.

 

I'll give you an example using the measure "Sum of PD_GROSS_AMOUNT".

Sum of PD_GROSS_AMOUNT = 

VAR Check_Filter_CoCode = ISFILTERED('table'[PD_CO_CODE])
VAR Check_Filter_Vendor = ISFILTERED('table'[PD_VENDOR]) 

var pd_amount = 
    if(
       [Check_Filter_CoCode] = TRUE() && [Check_Filter_Vendor] = TRUE(),
       {Sum of PD_GROSS_AMOUNT],
       BLANK()
       )
       
return pd_amount

 

 

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.