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
nveliss
Employee
Employee

Two different values for a filter in a chart

Hello,

I am trying to create a clustered column chart with two different values for the same filter.

 

I have two columns in my data. One is called Hours (where I have numerical values of hours) and the other column is called IsFlagged (where I have either Yes or No).

What I would like to do is to create two columns in my chart. One column with the sum of hours where Flag=YES and next to it a sum of total hours. If I add a slicer or a filter (on visual level) for the IsFlagged, it will filter everything.

 

Is the only way to do this by creating a new measure or column in my table? No link to any cube or live data.

Thanks!

1 ACCEPTED SOLUTION

hi  @nveliss 

To my knowledge, create a new measure is the only way to do this, you could use ALL Function to get it.

https://radacad.com/now-you-see-me-use-cases-of-all-dax-function-in-power-bi

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@nveliss , not very clear.

 

You can removefilter or all on Flag

 

calculate([measure],removefilters(Table[flag])

calculate([measure],filter(all(Table),Table[flag]="Y")

Thanks @amitchandak ,

this is what I eventually did. I created a Measure calculate(sum(Table[Hours],Table[flag]="Y") but was wondering whether there was a simpler way to do it through the visual/filter section by drag-dropping the field in the filter section. Hope it is more clear now...

Thanks again!

hi  @nveliss 

To my knowledge, create a new measure is the only way to do this, you could use ALL Function to get it.

https://radacad.com/now-you-see-me-use-cases-of-all-dax-function-in-power-bi

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@nveliss , I think I am still not on the same page. But have tried dragging the column having yes, no value to the legend ?

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.