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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Stewwe
Helper I
Helper I

Visual level filter with a conditional "or condition"

Hello dear PowerBI Community,

I have the following request from a user and would appreciate your help.

The user would like to be able to filter a visual in the following table:

 

ItemItem ValueItem Quantity
Item 149100
Item 21001
Item 3201000

if the value of an item is greater than x
or
if the quantity is greater than Y, value does not matter

 

For example:

Itemvalue >50

quantity >500

 

He wants to see Item 2 and Item 3

 

I hope you can help me!

 

Thank you
Stewwe

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi @Stewwe ,

 

First create 2 dim tables as below:

dim1 = GENERATESERIES(1,MAX('Table'[Item Quantity]),1)
dim2 = GENERATESERIES(1,MAX('Table'[Item Value]),1)

Then create a measure as below:

Measure = IF(SUM('Table'[Item Quantity])>SELECTEDVALUE(dim1[quantity])||SUM('Table'[Item Value])>SELECTEDVALUE(dim2[Value]),1,BLANK())

And you will see:

vkellymsft_0-1633678557058.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

View solution in original post

4 REPLIES 4
v-kelly-msft
Community Support
Community Support

Hi @Stewwe ,

 

First create 2 dim tables as below:

dim1 = GENERATESERIES(1,MAX('Table'[Item Quantity]),1)
dim2 = GENERATESERIES(1,MAX('Table'[Item Value]),1)

Then create a measure as below:

Measure = IF(SUM('Table'[Item Quantity])>SELECTEDVALUE(dim1[quantity])||SUM('Table'[Item Value])>SELECTEDVALUE(dim2[Value]),1,BLANK())

And you will see:

vkellymsft_0-1633678557058.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

Thank you! Exactly what I was looking for. 🙂

amitchandak
Super User
Super User

@Stewwe , Try a measure or all measures should follow

 

calculate(sum(Table[quantity]), filter(Table,Table[quantity] >500  || Table[Itemvalue] >50))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thank you @amitchandak for your solution.

However, the user should be able to set the filter values dynamically and not store fixed values in the formula.

 

That is the challenge 😉

 

Bye


Stewwe

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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