Forum Discussion
Relationship issue when Calendar table filtering two date columns in fact table
- 2 years ago
It depends on what you want.
You have two dates, which means that a query is open in all the days between open and close. If you want to be able to count that in any date, use this pattern: Events in progress – DAX PatternsIf you want to count how many queries were opened and closed in a day/month/quarter (regardless of when they have been closed), you should write:
Opened Queries = COUNTROWS ( Communications ) Closed Queries = CALCULATE ( COUNTROWS ( Communications ), USERELATIONSHIP ( Communications[Closed_On], Calendar[Date] ), KEEPFILTERS ( NOT ISBLANK ( Communications[Closed_On] ) ) )
It depends on what you want.
You have two dates, which means that a query is open in all the days between open and close. If you want to be able to count that in any date, use this pattern: Events in progress – DAX Patterns
If you want to count how many queries were opened and closed in a day/month/quarter (regardless of when they have been closed), you should write:
Opened Queries = COUNTROWS ( Communications )
Closed Queries =
CALCULATE (
COUNTROWS ( Communications ),
USERELATIONSHIP ( Communications[Closed_On], Calendar[Date] ),
KEEPFILTERS ( NOT ISBLANK ( Communications[Closed_On] ) )
)
Dear Sir,
Thank you so much for your help with this beautiful solution!
Wow! this is best solution I would have asked for and many thanks!
I apologize for the delayed response and I appreciate your patience!
The reason for delay is I wanted to test the report fully so that it did not cause any issues later on.
Your guidance has really helped me resolve the doubts.
I found your explanation on Events in progress – DAX Patterns very insightful.
If there's anything I can assist you with in the future, please don't hesitate to ask.
Thanks again for your support, it means a lot to me.