The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi Power BI Community,
I am working on a Power BI report where I have two table visuals, JobTable and DateTable, both sourced from the same dataset. Each row in JobTable represents a specific job with start and end dates, and DateTable shows daily details.
I would like to achieve the following: when I click on a row in JobTable, I want to dynamically filter DateTable to show only the dates falling within the selected job's start and end dates.
Here's what I've attempted so far:
SelectedEndDate = SELECTEDVALUE(Sheet1[End Date])
SelectedStartDate = SELECTEDVALUE(Sheet1[Start Date])
2. Created a column in DateTable to check if the date is within the selected date range.
IsDateInRange =
IF(
'Sheet1'[Date]>= [SelectedStartDate] &&
Sheet1[Date]<= [SelectedEndDate],
"Yes",
"No"
)
3. Use the new column as a filter for "Yes" in the DateTable
However the categorisation and filtering with this IsDateInRange column is not working as expected. Dates outside of the selected range are still showing up as "Yes".
See screenshot below and my problem replicated here
Can anyone guide me on the correct approach or suggest improvements to my DAX calcs?
Thank you in advance for your assistance!
My bad...here's the updated code: Also remove the column Date form the bottom visual
Proud to be a Super User!
Hi @amustafa
No worries, I tried your 2nd suggestion but unfortunately that doesn't seem to work either. Even when I remove the Date column.
But ideally I'd like to keep the date column this in the 2nd table to show that we're only keeping the dates that fall within any selected date range from the 1st table.
Update your IsDateInRange as following.
Proud to be a Super User!
Hi @amustafa,
Thanks for the suggetion. I tried it with the new calculation there and I'm now getting "No" for all dates. Even after I select a start and end date, the dates that are within range are still showing "No".
I've shared a screenshot example below
User | Count |
---|---|
28 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
34 | |
13 | |
12 | |
9 | |
7 |