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.
I have two tables, 'TeeTimes' and 'Closures' with data that I would like to compare.
The "Budget Tee Date" in the 'TeeTime' table to see if it falls between the 'Closure' tables "Close Date" and "Open Date". Then put the value of "Closure Type" from the 'Closure' table into the "Open/Close" column of the 'TeeTimes' table or simply the text value "Open" if no conflicts with the closures.
Department is a common field in both tables.
Table views
Relationship
Thanks in advance!
Solved! Go to Solution.
@dmgebauer Maybe:
Open/Close Column =
VAR __Dept = [Dept]
VAR __Course = [Course]
VAR __BudgetTeeDate = [Budget Tee Date]
VAR __Table = FILTER(ALL('Closures'), __BudgetTeeDate >= [Close Date] && __BudgetTeeDate <= [Open Date])
VAR __ClosureType = MAXX(__Table, [Closure Type])
VAR __Result = IF( __ClosureType = BLANK(), "Open", __ClosureType)
RETURN
__Result
@dmgebauer Maybe:
Open/Close Column =
VAR __Dept = [Dept]
VAR __Course = [Course]
VAR __BudgetTeeDate = [Budget Tee Date]
VAR __Table = FILTER(ALL('Closures'), __BudgetTeeDate >= [Close Date] && __BudgetTeeDate <= [Open Date])
VAR __ClosureType = MAXX(__Table, [Closure Type])
VAR __Result = IF( __ClosureType = BLANK(), "Open", __ClosureType)
RETURN
__Result
Close! but I will need to have the result based on the matching departments by each specific closure date range. Current formula seems to be applying a closure to all departments not the matching department.
Looks like it is working with this update
User | Count |
---|---|
78 | |
77 | |
38 | |
31 | |
28 |
User | Count |
---|---|
106 | |
96 | |
55 | |
49 | |
46 |