Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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... 🙂
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 33 | |
| 32 | |
| 32 |