This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowThe Fabric community is upgrading! Read all of the details including the timeline and what you can expect. Learn more
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... 🙂
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 25 | |
| 20 | |
| 20 | |
| 20 | |
| 20 |