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
Fowmy
Super User
Super User

Filter a dimension table based on a measure

Hi,

 

The issue I am having is, I am not able to find a way to use a slicer to filter Branch Codes by a measure.

 

The measure is Sales Growth By Branch.  I have 100 branches in the dimension table. I made a slicer from a disconnected table having two values "Positive" and "Negative".  I should be able to filter the report and all its visuals based on the slicer selection. once I select "Above", all branches having positive sales growth should be filtered. 

 

I tried to create a calculated column based on the above measure and secondary column to evaluate "Above" or "Below" and use it as a slicer but the measure doesn't respect outside filters like dates. 

 

 

Appreciate your help 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

1 ACCEPTED SOLUTION

Hi @Fowmy,

Please create a measure using the formula.

filter_measure =
IF (
    ISFILTERED ( Selection[Growth] ),
    IF (
        SELECTEDVALUE ( Selection[Growth] ) = "Negative"
            && Sales[Sales Growth] <= 0,
        1,
        0
    )
        + IF (
            SELECTEDVALUE ( Selection[Growth] ) = "Positive"
                && Sales[Sales Growth] > 0,
            1,
            0
        ),
    1
)


Then use it as a visual level page. The visual will I should filtered the report and all its visuals based on the slicer selection. When you select "Positive", all branches having positive sales growthwilled be filtered. 
  when select Positivewhen select Positive
when select Negeaivewhen select Negeaive
Notice, we can not add a measure as page level filter, so you need to the filted measure above as each visual in the page. Please down the attchment file for analysis.

Best Regards,
Angelia

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

Hi,

 

I have attached a sample .pbix file to further understand the issue.

 

https://1drv.ms/u/s!AmoScH5srsIYt0qpDyOfvYeGXhcn

 

 

Thanks

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi @Fowmy,

Please create a measure using the formula.

filter_measure =
IF (
    ISFILTERED ( Selection[Growth] ),
    IF (
        SELECTEDVALUE ( Selection[Growth] ) = "Negative"
            && Sales[Sales Growth] <= 0,
        1,
        0
    )
        + IF (
            SELECTEDVALUE ( Selection[Growth] ) = "Positive"
                && Sales[Sales Growth] > 0,
            1,
            0
        ),
    1
)


Then use it as a visual level page. The visual will I should filtered the report and all its visuals based on the slicer selection. When you select "Positive", all branches having positive sales growthwilled be filtered. 
  when select Positivewhen select Positive
when select Negeaivewhen select Negeaive
Notice, we can not add a measure as page level filter, so you need to the filted measure above as each visual in the page. Please down the attchment file for analysis.

Best Regards,
Angelia

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.