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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Brianoreilly
Helper II
Helper II

Calculated Column: If Statement with Date Slicer

Hi Folks, 

 

I have 3 tables: 

1: Timecard Table

2: Date Table 

3: Contact Table. 

 

I am hoping to build a Calculated Column (not a measure). 

 

The logic I require is if the: Resources Start Date and End Date are blank  then pull the minimum date selected in the date table slicer. 

It is currently pulling the minimum date in the entire table.

 

Any help appreciated.

 

Issue with the code in red. How can I get to slicer value instead of the table minimum value.

 

 

Test = 
VAR startdate =
    
        CALCULATE (
            VALUES ( Contact[Start Date] ),
            FILTER ( Contact, Contact[Id] = 'Timecard Split'[Resource ID] )
        )
    

VAR enddate =
    
        CALCULATE (
            VALUES(Contact[Start Date]),
            FILTER ( Contact, Contact[Id] = 'Timecard Split'[Resource ID] )
        )
    

RETURN
    (IF(And(ISBLANK(startdate),ISBLANK(enddate)),[Minimum Date],startdate))

 date issue.JPG

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi, @Brianoreilly

You said "I am hoping to build a Calculated Column (not a measure)."

 calculated columns and calculated  tables are not affected by any slicer.

https://community.powerbi.com/t5/Desktop/New-table-with-measures-values/td-p/189124

 

 calculated columns and calculated  tables are only "computed during database processing(e.g. data refresh) and then stored in the model, they do not response to user selections on the report(like a Slicer)."

 

So if you want the slicer can affect the values, you need to build a Calculated measure (not a column).

 

Best Regards,

Lin

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors