Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
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
I am working with data broken down by a state field. There are some results coming through from specific states that should not before a certain date. I need to filter out all data coming through for the state of WI whenever the date was before 9/19/2022. I tried to do a simple IF statement such as this:
Filter = IF([State]='WI' AND [Date]<DATE(2022,9,19),1,0)
The measure is full of errors: cannot find either of my fields, AND is not a correct
Solved! Go to Solution.
Hi @trevordunham ,
I think you should use "&&" between conditions or use AND(MAX([State])='WI',MAX([Date])<DATE(2022,9,19)).
Filter =
IF ( MAX([State]) = 'WI' && MAX([Date]) < DATE ( 2022, 9, 19 ), 1, 0 )
Then add this measure into visual level filter and set it to show items when value =1.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@trevordunham , A measure would be like
Countrows(Filter(Table, [State]="WI" && [Date]<DATE(2022,9,19) ))
or
calculate(sum(Table[Value]), Filter(Table, [State]="WI" && [Date]<DATE(2022,9,19) ))
@amitchandak Thanks for the help! I was able to get the first measure to work. I just wanted to make sure I am using it as a filter correctly, how would I filter on it, less than 1? When I try that it seems to remove rows where we see WI results with date 9/19/2022 incorrectly.
Hi @trevordunham ,
I think you should use "&&" between conditions or use AND(MAX([State])='WI',MAX([Date])<DATE(2022,9,19)).
Filter =
IF ( MAX([State]) = 'WI' && MAX([Date]) < DATE ( 2022, 9, 19 ), 1, 0 )
Then add this measure into visual level filter and set it to show items when value =1.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 32 | |
| 27 | |
| 25 |