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.
I'm still fairly new to this Power BI thing, but I am trying to get information to display from our database based on these filters:
Estimated Sale Price >= $1,000,000
OR
Estimated Value >= $80,000
In "Report Level Filters", where I drop in those to fields ("Estimated Sale Price" and "Estimated Value"), and I add those parameters, it's treated as an AND filter, so the data must meet both of those criteria. I just want one or the other.
How would I do this?
Thanks
Solved! Go to Solution.
You could do this in query editor to set a flag using an if statement then use that flag for your page level filter.
since I don't know your field names for certain I will use what you have provided.
In Query editor, add a custom column with a unique name.
it should be:
if [Estimated Sale Price] >= 1,000,000 then 1 else if [Estimated Value] >= 80,000 then 1 else 0
depending on your data of course. This will add a column populated with 1s and 0s that can be used as filter flags for your "or" statement.
Add it as a page filter then select 1 to filter the results. May not be elegant but it should work.
Proud to be a Super User!
Hi @peterg417,
The solution @kcantor posted is a perfect one. If you only want to get the data from one table. For example, you get data from SQL Server database, you can filter your resouce table using SQL statement. Type the similar SQL satement below to the window highlighted in blue line.
SELECT * FROM Table WHERE Table.Estimated Sale Price >= $1,000,000 OR Table.Estimated Value >= $80,000
Different from the one @kcantor posted. In your Power BI desktop data model, there are only rows where Estimated Sale Price >= $1,000,000 OR Estimated Value >= $80,000. Other rows are not unloaded in the model.
Best Regards,
Angelia
Thanks guys! That's perfect!
You could do this in query editor to set a flag using an if statement then use that flag for your page level filter.
since I don't know your field names for certain I will use what you have provided.
In Query editor, add a custom column with a unique name.
it should be:
if [Estimated Sale Price] >= 1,000,000 then 1 else if [Estimated Value] >= 80,000 then 1 else 0
depending on your data of course. This will add a column populated with 1s and 0s that can be used as filter flags for your "or" statement.
Add it as a page filter then select 1 to filter the results. May not be elegant but it should work.
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
77 | |
69 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |