The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have a page that shows values over time of day for a single day.
The user can drill through on the time to another page that I wish to show information on that time +- 1 hour from another table.
I have the time value coming through as CTime and am using DAX to create 2 DateTime measures BeginTime and EndTime and they are both correct.
What I cannot figure out is how to filter another table of data using those 2 times:
Example
Table to filter: TimeActions
DateTime ActionDateTime Varchar Action
20210420 0300 Action1
20210420 0600 Action2
20210420 0700 Action3
20210420 0800 Action4
20210420 1100 Action5
If CTime comes through at 20210420 0700 I should see Actions 2,3,4
Thanks
Hi @JSher,
Try measure as:
Measure 3 =
CALCULATE(
MAX(TimeActions[Varchar Action]),
FILTER(
ALL(TimeActions),
TimeActions[DateTime ActionDateTime]>[BeginTime]-1/24 && TimeActions[DateTime ActionDateTime]<[EndTime]+1/24
)
)
If is does not work, please provide your pbix after removing sensitive information.
Best Regards,
Link
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
I tried this every way I could including using a filtered table just with the filter:
FILTER(
ALL(TimeActions),
TimeActions[DateTime ActionDateTime]>[BeginTime]-1/24 && TimeActions[DateTime ActionDateTime]<[EndTime]+1/24
)
but could not get it to work.
Please find attached file to test a filter of +-1 hour on a drill through time.
Ive never posted a file on here so attempting a link in google drive:
Thanks
User | Count |
---|---|
80 | |
73 | |
39 | |
30 | |
28 |
User | Count |
---|---|
107 | |
97 | |
55 | |
47 | |
46 |