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
Anonymous
Not applicable

Tableau to DAX

Hi, I need help converting these two calculated fields from Tableau to DAX.

 

Freeze Date

IF ENDSWITH([Academic Period Id],'9') THEN

DATEPARSE('MMM-dd-yyyy','Aug-15-'+LEFT([Academic Period Id],4))

ELSE DATEPARSE('MMM-dd-yyyy','Jan-15-'+LEFT([Academic Period Id],4))

END

 

Resident at Freeze

IF [Resident Length] > 0

AND [Academic Period Id] = '202009' THEN 'Y'

ELSEIF [Resident Length] > 0

AND [Resident Start Date] <= [Freeze Date] AND [Resident End Date] >= [Freeze Date]

THEN 'Y' ELSE 'N' END

 

Thanks!

1 ACCEPTED SOLUTION

@Anonymous Please try this:-

Resident at Freeze =
IF (
    [Resident Length] > 0
        && [Academic Period Id] = 202009,
    "Y",
    IF (
        [Resident Length] > 0
            && [Resident Start Date] <= [Freeze Date]
            && [Resident End Date] >= [Freeze Date],
        "Y",
        "N"
    )
)

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

3 REPLIES 3
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

If you could provide some sample data in text format(not a screenshot) with expected output then it would be more helpful but you could try this:-

Freeze Date =
VAR _endswith =
    RIGHT ( [Academic Period Id], 1 )
VAR _startwith =
    LEFT ( [Academic Period Id], 4 )
RETURN
    IF (
        _endswith = "9",
        FORMAT ( DATE ( LEFT ( [Academic Period Id], 4 ), 08, 15 ), "MMM-dd-yyyy" ),
        FORMAT ( DATE ( LEFT ( [Academic Period Id], 4 ), 01, 15 ), "MMM-dd-yyyy" )
    )

 

Resident at Freeze =
IF (
    [Resident Length] > 0
        && [Academic Period Id] = "202009",
    "Y",
    IF (
        [Resident Length] > 0
            && [Resident Start Date] <= [Freeze Date]
            && [Resident End Date] >= [Freeze Date],
        "Y",
        "N"
    )
)

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

For Resident at Freeze, it throws an error:

 

DAX comparison operations do not support comparing values of type Date with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.

@Anonymous Please try this:-

Resident at Freeze =
IF (
    [Resident Length] > 0
        && [Academic Period Id] = 202009,
    "Y",
    IF (
        [Resident Length] > 0
            && [Resident Start Date] <= [Freeze Date]
            && [Resident End Date] >= [Freeze Date],
        "Y",
        "N"
    )
)

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors