Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a SQL statement that retrieves records based on this WHERE clause:
WHERE a.postingdate >= '2018-01-01' OR a.backoutdate >= '2018-01-01'
Then a have a disconnected date table where users can make their desired date selections via a slicer. They are basically just filtering down the table of records returned above to their desired recordset. It doesn't look like I can use the Filters pane, because it doesn't appear to allow the OR condition over two separate columns (postingdate OR backoutdate).
I thought a calculated column would do it, with syntax something like this:
Solved! Go to Solution.
Interesting problem. A calc column won't work if you want the user to select the value. You will need to basically build a Union query to create the filter table and then return a result in a measure. You can place the measure in the table visual or possibly in the visual filters pane (if you don't want to see it in the table). This should return 1 if the row meets the criteria it assumes your visual has some row level primary key (or combination of columns that make it a pk)
Show =
COUNTROWS (
DISTINCT (
UNION (
FILTER ( table, table[date1] >= DATE ( 2020, 1, 1 ) ),
FILTER ( table, table[date2] >= DATE ( 2020, 1, 1 ) )
)
)
)
Interesting problem. A calc column won't work if you want the user to select the value. You will need to basically build a Union query to create the filter table and then return a result in a measure. You can place the measure in the table visual or possibly in the visual filters pane (if you don't want to see it in the table). This should return 1 if the row meets the criteria it assumes your visual has some row level primary key (or combination of columns that make it a pk)
Show =
COUNTROWS (
DISTINCT (
UNION (
FILTER ( table, table[date1] >= DATE ( 2020, 1, 1 ) ),
FILTER ( table, table[date2] >= DATE ( 2020, 1, 1 ) )
)
)
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 134 | |
| 96 | |
| 78 | |
| 67 | |
| 65 |