Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
There's probably a nice trick here, but I'm struggling with it. We are using the standard Date Range Slicer. The calendar date is connected to the create date on a Ticket Table. I cannot make an active connection between another date in a Document table and the calendar because it would create a circular relationship. I want to check a Start Date and an End Date in the Document table to see if these dates fall within the range of those selected with the Date Range Slicer to determine if a particular document should be included in a calculation. Does anyone know how to do this - to check these dates against those selected? Thanks in advance!
Solved! Go to Solution.
Hi @Shelley,
Check the answer I gave on this post in this case I'm calculating the number of days but the formula can be readjusted to give a YES / NO text instead. the adjusted formula is below:
YES_NO = VAR START_DATE = MIN ( DimDate[Date] ) VAR END_DATE = MAX ( DimDate[Date] ) RETURN IF( SUMX ( SUMMARIZE ( FactTable; FactTable[StartDate]; FactTable[EndDate]; "DAYS"; IF ( FactTable[StartDate] < START_DATE && FactTable[EndDate] < START_DATE || FactTable[StartDate] > END_DATE && FactTable[EndDate] > END_DATE; 0; DATEDIFF ( IF ( FactTable[StartDate] < START_DATE; START_DATE; FactTable[StartDate] ); IF ( FactTable[EndDate] > END_DATE; END_DATE; FactTable[EndDate] ); DAY ) ) ); [DAYS] ) > 0 ; "YES"; "NO")
In this case you will get the following result.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Shelley,
Check the answer I gave on this post in this case I'm calculating the number of days but the formula can be readjusted to give a YES / NO text instead. the adjusted formula is below:
YES_NO = VAR START_DATE = MIN ( DimDate[Date] ) VAR END_DATE = MAX ( DimDate[Date] ) RETURN IF( SUMX ( SUMMARIZE ( FactTable; FactTable[StartDate]; FactTable[EndDate]; "DAYS"; IF ( FactTable[StartDate] < START_DATE && FactTable[EndDate] < START_DATE || FactTable[StartDate] > END_DATE && FactTable[EndDate] > END_DATE; 0; DATEDIFF ( IF ( FactTable[StartDate] < START_DATE; START_DATE; FactTable[StartDate] ); IF ( FactTable[EndDate] > END_DATE; END_DATE; FactTable[EndDate] ); DAY ) ) ); [DAYS] ) > 0 ; "YES"; "NO")
In this case you will get the following result.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |