The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi
I have a visual which basically shows this (sales for each department and status of approval, only for the last three days):
Department | No. Of Sales | Status | Date |
Dept. 1 | 8 | Approved | 16.09.2021 |
Dept. 1 | 2 | Not approved | 16.09.2021 |
Dept. 2 | 11 | Approved | 16.09.2021 |
Dept. 3 | 4 | Approved | 16.09.2021 |
Dept. 1 | 5 | Approved | 15.09.2021 |
Dept. 2 | 8 | Approved | 15.09.2021 |
Dept. 3 | 7 | Approved | 15.09.2021 |
Dept. 3 | 1 | Not approved | 15.09.2021 |
Dept. 1 | 4 | Approved | 14.09.2021 |
Dept. 2 | 3 | Approved | 14.09.2021 |
Dept. 3 | 9 | Approved | 14.09.2021 |
What I'm trying to figure out how to filter this so that it shows the complete results for yesterday (16.09.21) regardless of sales being approved or not. And for all other dates it only shows rows where sales aren't approved. Which would be this:
Department | No. Of Sales | Status | Date |
Dept. 1 | 8 | Approved | 16.09.2021 |
Dept. 1 | 2 | Not approved | 16.09.2021 |
Dept. 2 | 11 | Approved | 16.09.2021 |
Dept. 3 | 4 | Approved | 16.09.2021 |
Dept. 3 | 1 | Not approved | 15.09.2021 |
Dept. 2 | 2 | Not approved | 14.09.2021 |
Been trying to write a measure to add to filters, but can't seem to find the correct formula.
Regards
MadBern
Solved! Go to Solution.
@MadBern85 You seem to need a Complex Selector: The Complex Selector - Microsoft Power BI Community
Maybe:
Selector Measure =
VAR __Yesterday = TODAY() - 1
RETURN
SWITCH(TRUE(),
MAX([Date]) = __Yesterday,1,
MAX([Status] = "Not approved",1,
0
)
@MadBern85 You seem to need a Complex Selector: The Complex Selector - Microsoft Power BI Community
Maybe:
Selector Measure =
VAR __Yesterday = TODAY() - 1
RETURN
SWITCH(TRUE(),
MAX([Date]) = __Yesterday,1,
MAX([Status] = "Not approved",1,
0
)
Thanks a bunch, that seemed to do the trick! Only had to add the missing ")" after the second MAX statement.
Regards
MadBern
@MadBern85 Ah yes, the syntax... 🙂