Forum Discussion

JonPBNES's avatar
JonPBNES
Helper I
7 years ago
Solved

Apply visual level interactions without a relationship

I know, it sounds silly right?    So, we've got a start date, and end date and a client ID. We wanted an open cases measure. We followed the terribly useful https://powerpivotpro.com/2013/04/counti...
  • jdbuchanan71's avatar
    jdbuchanan71
    7 years ago

    Good morning JonPBNES 

    As is typical, turns out we were over thinking it.  We didn't need USERELATIONSHIP, we can just read the date range selected, feed that to our filter measure and go.  We do still need to compare Start Date and End Date to the date range.

    OpenCaseFilter = 
    VAR CompareStartDate = FIRSTDATE ( OpenCasesTable[Date] )
    VAR CompareEndDate = LASTDATE ( OpenCasesTable[Date] )
    RETURN
        IF (
            CALCULATE (
                COUNTROWS ( 'openfiltertest' ),
                FILTER (
                     openfiltertest,
                    'openfiltertest'[Start Date] <= CompareEndDate
                        && 'openfiltertest'[End Date] >= CompareStartDate
                )
            ) >= 1,
            "In",
            "Out"
        )

    You can see the result we want even after I deleted the link between the two tables.