Forum Discussion

sivarajan21's avatar
sivarajan21
Post Prodigy
2 years ago
Solved

Relationship issue when Calendar table filtering two date columns in fact table

Hi,   I have a model where Calendar table filters communication table as below: Here Calendar table Date column should filter communication table  Created_on and Closed_on (both columns) as ...
  • marcorusso's avatar
    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 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] ) )
    )