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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mariuschrc
Frequent Visitor

SWITCH and DATEDIFF not working anymore

Months ago I used SWITCH this way, and it worked, no errors, all perfect.

mariuschrc_0-1705609051644.png

 

Today, even if I am using the same table/data I previously used, I cannot recreate this measure. What happened in the meantime?

mariuschrc_1-1705609386073.png

 

The same happens with DATEDIFF function. Intellisense not showing anymore and columns from the table are not considered by these functions in the new PowerBi format.

 

 

 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

this will work if you are creating a column, but if you are creating a measure it will not work.
To make it work, wrap all the specified columns in your MAX function measure like so

MAX('VulnerabilityMgmt'[Today])- ,,,,,

View solution in original post

2 REPLIES 2
Ahmedx
Super User
Super User

this will work if you are creating a column, but if you are creating a measure it will not work.
To make it work, wrap all the specified columns in your MAX function measure like so

MAX('VulnerabilityMgmt'[Today])- ,,,,,

Daniel29195
Super User
Super User

hello  @mariuschrc 

it is weird that it was working, 

cause as far as i know you cant point to  a column like this unless you are using an iterator . 

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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