Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I am creating a report that look sat two dates; Date1 and Date 2. I am trying to create a filter that looks at a selected date range and determines whether Date1 OR Date2 falls within that range.
i.e. a customer can select a date range 01/01/2023 - 15/01/2023 and all these records would appear in the table:
Record | Date1 | Date2 |
1 | 01/01/2023 | 05/01/2023 |
2 | 15/12/2022 | 10/01/2023 |
3 | 04/01/2023 | 02/02/2023 |
Is that possible? I am struggling because of the limits of passing selected values into dax columns, and there are no set periods where a customer might be looking between records.
hi @joechristo
Supposing you have a data table like:
1) plot a slicer with a dates table like:
dates =
CALENDAR(
MIN( MIN(data[Date1]), MIN(data[Date2])),
MAX( MAX(data[Date1]), MAX(data[Date2]))
)
(or you create the date table in other ways)
2) try to plot a table visual with all the columns, but filter that visual with a measure like:
measure =
VAR _max = MAX(dates[date])
VAR _min = MIN(dates[date])
VAR result =
IF(
OR(
MAX(data[Date1])<=_max&&MAX(data[Date1])>=_min,
MAX(data[Date2])<=_max&&MAX(data[Date2])>=_min
),
1,
0
)
RETURN result
3) choose value 1 for the measures
it worked like:
For this report I need two. Is there any way to do it? In our previous reporting software this is what is implemented and we need to reproduce it.
I want a report page with a table and filter like this:
Where the table is filtered so that either Date Appeal Determined or Date Decision Issued falls within the date range specified in the slicer
Hi Gokul, this isn't what I'm asking. This is regarding two separate date fields, not two dates in the same date field
User | Count |
---|---|
16 | |
15 | |
14 | |
12 | |
11 |
User | Count |
---|---|
19 | |
16 | |
14 | |
11 | |
9 |