Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
leandroparischi
Frequent Visitor

Create a filter based on 3 date columns

Hello, I'm kind stuck here.

I have 3 columns of the date type which, in one contains the PC creation date; in the second column creation date CP; and in the third column creation date NE.

I need to create a filter that gives me results like:
PAID (Filter PC containing NE and CP);
OPEN (Filter PC that contains NE and does not contain CP);
ALL (Filter PC containing NE and whether or not CP)

How can I filter the 3 columns to compare whether or not there are values ​​in the same rows? And so do the filter?

1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @leandroparischi ,

 

Would you please create a table that contains on column for "PAID","OPEN","ALL" for slicer, and refer to the following measure:

 

 

measure =
VAR CPVALUE =
    CALCULATETABLE ( VALUES ( 'Table'[creation date NE] ), ALL ( 'Table' ) )
VAR NEVALUE =
    CALCULATETABLE ( VALUES ( 'Table1'[creation date NE] ), ALL ( 'Table1' ) )
RETURN
    SWITCH (
        SELECTEDVALUE ( 'Slicer'[Column] ),
        "PAID", CALCULATE (
            ....,
            FILTER (
                Table3,
                Table3[PC creation date] IN CPVALUE
                    && Table3[PC creation date] IN NEVALUE
            )
        ),
        "OPEN", CALCULATE (
            ....,
            FILTER (
                Table3,
                NOT ( Table3[PC creation date] IN CPVALUE )
                    && Table3[ PC creation date] IN NEVALUE
            )
        ),
        "ALL", CALCULATE (
            .....,
            FILTER ( Table3, Table3[PC creation date] IN CPVALUE )
                && NOT ( Table3[PC creation date] IN NEVALUE )
        )
    )

 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

View solution in original post

1 REPLY 1
v-deddai1-msft
Community Support
Community Support

Hi @leandroparischi ,

 

Would you please create a table that contains on column for "PAID","OPEN","ALL" for slicer, and refer to the following measure:

 

 

measure =
VAR CPVALUE =
    CALCULATETABLE ( VALUES ( 'Table'[creation date NE] ), ALL ( 'Table' ) )
VAR NEVALUE =
    CALCULATETABLE ( VALUES ( 'Table1'[creation date NE] ), ALL ( 'Table1' ) )
RETURN
    SWITCH (
        SELECTEDVALUE ( 'Slicer'[Column] ),
        "PAID", CALCULATE (
            ....,
            FILTER (
                Table3,
                Table3[PC creation date] IN CPVALUE
                    && Table3[PC creation date] IN NEVALUE
            )
        ),
        "OPEN", CALCULATE (
            ....,
            FILTER (
                Table3,
                NOT ( Table3[PC creation date] IN CPVALUE )
                    && Table3[ PC creation date] IN NEVALUE
            )
        ),
        "ALL", CALCULATE (
            .....,
            FILTER ( Table3, Table3[PC creation date] IN CPVALUE )
                && NOT ( Table3[PC creation date] IN NEVALUE )
        )
    )

 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.