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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jawilson808
Helper I
Helper I

Filtered Value

Hi there!

 

I am looking for assistance with creating a dax. What I am trying to accomplish is allow users to toggle on and off data within a line/column chart. I have created a table of the measures that i would like them to ultimately select the values to be shown within the illustration (Budget, forecast, sales, etc.). I found a dax that calculates the value based on the selection. However, I am running into an issue as to when multiple values are selected. 

 

To keep it simple the following formula works great. 

switch(LASTNONBLANK(_VisibleMeasures[Column1],"Blank"),"Budget Revenue",[Budget Revenue]))
 
this valule is dropped within the column valules on the column chart. If the Budget revenue is selected within the filters, the column shows, if nothing is selected it disappers.  Exactly what I desire.
 
But the end goal would to be able to have multiple values as such:
Value 1:switch(LASTNONBLANK(_VisibleMeasures[Column1],"Blank"),"Budget Revenue",[Budget Revenue]))
Value 2:switch(LASTNONBLANK(_VisibleMeasures[Column1],"Blank"),"Forecast Revenue",[Forecast Revenue]))
Value x:switch(LASTNONBLANK(_VisibleMeasures[Column1],"Blank"),"x",[x]))
 
Once the user selects 1 or multiple values, only the desired values show, however I am having no success. I have attemplted a formula with hasonevalue, but their can be multiple values. 
 
Any help would be greatly appreciated. I hope this make sense.
1 ACCEPTED SOLUTION
jawilson808
Helper I
Helper I

I was able to solve this by adding a table for the values I wanted to be selected within the ullustration. Then i used the following dax based on the selection. 

 

Visible Budget Revenue = var logicTest= countrows(distinct(filter(allselected(_VisibleMeasures[Visible Measures]),_VisibleMeasures[Visible Measures]="Budget Revenue")))=1 return if(LogicTest,[Budget Revenue],blank())
 
The dax was replicated for each of the measures that a user could select in the illustration. The only downside is that all possible possible measures will show even if not selected. I guess the upside to this illustrates what can be included with  visualizationimage.pngimage.png

View solution in original post

1 REPLY 1
jawilson808
Helper I
Helper I

I was able to solve this by adding a table for the values I wanted to be selected within the ullustration. Then i used the following dax based on the selection. 

 

Visible Budget Revenue = var logicTest= countrows(distinct(filter(allselected(_VisibleMeasures[Visible Measures]),_VisibleMeasures[Visible Measures]="Budget Revenue")))=1 return if(LogicTest,[Budget Revenue],blank())
 
The dax was replicated for each of the measures that a user could select in the illustration. The only downside is that all possible possible measures will show even if not selected. I guess the upside to this illustrates what can be included with  visualizationimage.pngimage.png

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.