Forum Discussion
If statement with multiple slicers
Hi, I'm new to PBI and need some help creating a measure and will only display data selected by filters
I have a filter for [Year]
2020
2019
2018
i have a filter for [Company]
A
B
C
the display table has [Employees] and number of [Orders]
I would like to create a [Result]Measure that looks at [Orders] and If more than 5 orders completed then writes Good, otherwise write Bad
and only display that measure for [Employees] that were selected from the filter
i.e if i select the filter 2020 and B, i would like somethin like this to display
| Year | Company | Employee | Orders | Result |
| 2020 | B | Joe | 2 | Bad |
| 2020 | B | Jane | 6 | Good |
| 2020 | B | John | 4 | Bad |
| 2020 | B | Smith | 1 | Bad |
Thank you
- Anonymous5 years ago
Go to the relationship panel, check whether is a relationship. Usually relationship will be automatically created for very relevant tables, if not you need to add it manually.
Once you have created the measure, simply filter Year to 2020, Company to B will get your expected output.
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- amitchandakSuper User
rafalvarezt , Try
measure = if(sum(table[Orders]) >5,"Good", "Bad")
column = if((table[Orders]) >5,"Good", "Bad")
- Greg_DecklerCommunity Champion
rafalvarezt - Try something like:
Measure = IF(SUM('Table'[Orders])>5,"Good","Bad")Shouldn't your slicers already be filtering your table or are they disconnected tables?
- rafalvareztNew Member
when i enter the measure suggested, it does display the new [Result] column but also displays all employees for all years
Does that mean the tables are disconnected? if so, is there a way to fix?
Thanks again
- AnonymousNot applicable
Go to the relationship panel, check whether is a relationship. Usually relationship will be automatically created for very relevant tables, if not you need to add it manually.
Once you have created the measure, simply filter Year to 2020, Company to B will get your expected output.
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.