Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am working on two tables Events & Events_Summary:
I want to compare an event date between the start date and end date of every cycle and then display the cycle name for every event. If there is no cycle on that date of the event, then we display 'No-Cycle'. Can anyone help me with any solution in DAX? Is there any lookup for this
My Data looks like this
Events
Events_Summary
Desired Output in Events_Table
[Cycle] = // calc column in Events
var __date = Events[Event_Date]
var __filteredForCycles =
filter(
Events_Summary,
Events_Summary[Cycle_Start_Date] <= __date
&&
__date <= Events_Summary[Cycle_End_Date]
)
var __cycleCount =
COUNTROWS( __filteredForCycles )
var __cycle =
MAXX(
__filteredForCycles,
Events_Summary[Cycyle_Name]
)
var __output =
switch( TRUE(),
__cycleCount = 1, __cycle,
__cycleCount = 0, "No-Cycle",
// If your table has mutually exclusive
// cycles, this should not happen.
"Many Cycles"
)
return
__output
Create a table visual holding the columns of the 1st table.
Create a measure as follows:
Create a variable to hold event_date -> _edate
Create a variable to find the cycle_name in the 2nd table by filtering the 2nd table to find row where cycle_start_date < edate and cycle_end_date > edate. -> _cycleName
If _cycleName is empty return "No-cycle" otherwise return _cycleName
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
9 | |
7 | |
6 | |
6 |
User | Count |
---|---|
29 | |
11 | |
11 | |
10 | |
6 |