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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I'm trying to use Time Intelligence to calculate the specific date to show a video based on the date of an event.
I have 2 tables:
- a simple Azure SQL table - 'event', that contains a boolean field [videoflag]
- A full function calculated 'DATE' table (from SQLBI)
and a slicer that filters the 'event' table for a specific event by name.
If the [videoflag] for that event is TRUE, then the [video1] measure should display the date of the Monday, four weeks prior to the event date.
Solved! Go to Solution.
hi, @bmurfy
Adjust your formula as below:
In "event" table, add a Calendar WeekNumber column from calendar table
Calendar WeekNumber = RELATED('Date'[Calendar WeekNumber])
Then use this formula
Video1 = var flgvideo = VALUES('event'[VideoFlag]) var eventdate = LASTDATE('Date'[Date]) var firstvideo = MIN(event[Calendar WeekNumber]) -4 return IF(flgvideo=TRUE(), CALCULATE( MIN('Date'[Date]),FILTER(ALL('Date'), 'Date'[Calendar YearNumber]=YEAR(eventdate)&& 'Date'[Calendar WeekNumber]= firstvideo&& 'Date'[Week Day] = "Mon") ), "No Video" )
Result:
Best Regards,
Lin
hi, @bmurfy
Sampe pbix file or Sample data and expected output would help tremendously.
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Best Regards,
Lin
hi, @bmurfy
Adjust your formula as below:
In "event" table, add a Calendar WeekNumber column from calendar table
Calendar WeekNumber = RELATED('Date'[Calendar WeekNumber])
Then use this formula
Video1 = var flgvideo = VALUES('event'[VideoFlag]) var eventdate = LASTDATE('Date'[Date]) var firstvideo = MIN(event[Calendar WeekNumber]) -4 return IF(flgvideo=TRUE(), CALCULATE( MIN('Date'[Date]),FILTER(ALL('Date'), 'Date'[Calendar YearNumber]=YEAR(eventdate)&& 'Date'[Calendar WeekNumber]= firstvideo&& 'Date'[Week Day] = "Mon") ), "No Video" )
Result:
Best Regards,
Lin
Perfect, Thanks!
Just for clarity...
a) was the week # column necessary in the event table to eliminate multiple rows returning in the results?
b) Why was the FILTER necessary?
c) What was your formula for the Videoflag measure?
d) wondering how you got all the event rows to show up? When I de-select the slicer I get an error with [video1]
"A table of multiple values was supplied where a single value was expected"
Thanks again!
hi, @bmurfy
1. If week # column not in the event table, there are many week # column in calendar table, it will return every week # for 2019.
2. FILTER is not necessary
Best Regards,
Lin
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.