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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
kristi_in_heels
Helper II
Helper II

Switch Statement Not Working

Hello,

 

I have a switch statement which I am using to apply a conditional formatting in a matrix table where the returned value of the statement is 1.

 

I have the same switch statement replicated 4 times with a different column being used to measure against. 3 of the 4 are working perfectly, but the last is not.

 

Is there something I have missed in the statement?

 

All the columns are formatted the same, and all relationships are the same.

 

 

WORKING STATEMENT:

TG FS Budget Before Today ALL =

SWITCH (

TRUE (),

MAX('All Projects'[ProjectPhaseDescription])="PFS"&& max('All Projects'[FS - Budget])<Today(),1,

max('All Projects'[ProjectPhaseDescription])="Not Started"&& max('All Projects'[FS - Budget])<Today(),1,

max('All Projects'[ProjectPhaseDescription])="CON"&& max('All Projects'[FS - Budget])<Today(),1,0)

 

 

NOT WORKING STATEMENT:

TG EXE Budget Before Today ALL =

SWITCH (

TRUE (),

MAX('All Projects'[ProjectPhaseDescription])="FS"&& max('All Projects'[EXE - Budget])<Today(),1,

MAX('All Projects'[ProjectPhaseDescription])="PFS"&& max('All Projects'[EXE - Budget])<Today(),1,

max('All Projects'[ProjectPhaseDescription])="Not Started"&& max('All Projects'[EXE - Budget])<Today(),1,

max('All Projects'[ProjectPhaseDescription])="CON"&& max('All Projects'[EXE - Budget])<Today(),1,0)

1 ACCEPTED SOLUTION
kristi_in_heels
Helper II
Helper II

It seems Power BI needed an update, and then my original statement worked again.

 

Thank you for the time taken to review.

View solution in original post

5 REPLIES 5
kristi_in_heels
Helper II
Helper II

It seems Power BI needed an update, and then my original statement worked again.

 

Thank you for the time taken to review.

v-prasare
Community Support
Community Support

@kristi_in_heels,

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for your issue worked? or let us know if you need any further assistance here?

 

 

 

Thanks,

Prashanth Are

MS Fabric community support

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query

v-prasare
Community Support
Community Support

Hi @kristi_in_heels,

Can you try below query once and let me know if this helps:

 

TG EXE Budget Before Today COLUMN =

VAR Phase = TRIM('All Projects'[ProjectPhaseDescription])

VAR BudgetDate = 'All Projects'[EXE - Budget]

RETURN

SWITCH(

    TRUE(),

    Phase IN {"FS", "PFS", "CON", "Not Started"} &&

    NOT ISBLANK(BudgetDate) &&

    BudgetDate < TODAY(), 1,

    0

)

 

 

 

 

 

 

Thanks,

Prashanth Are

MS Fabric community support

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query

pankajnamekar25
Super User
Super User

Hello @kristi_in_heels 

 

try this

TG EXE Budget Before Today ALL =
SWITCH (
TRUE (),
MAX('All Projects'[ProjectPhaseDescription])="FS" && NOT ISBLANK(MAX('All Projects'[EXE - Budget])) && MAX('All Projects'[EXE - Budget])<TODAY(), 1,
MAX('All Projects'[ProjectPhaseDescription])="PFS" && NOT ISBLANK(MAX('All Projects'[EXE - Budget])) && MAX('All Projects'[EXE - Budget])<TODAY(), 1,
MAX('All Projects'[ProjectPhaseDescription])="Not Started" && NOT ISBLANK(MAX('All Projects'[EXE - Budget])) && MAX('All Projects'[EXE - Budget])<TODAY(), 1,
MAX('All Projects'[ProjectPhaseDescription])="CON" && NOT ISBLANK(MAX('All Projects'[EXE - Budget])) && MAX('All Projects'[EXE - Budget])<TODAY(), 1,
0
)

 

 

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

Thank you for your reply.

 

Unfortunately the suggestion does not work either.

 

I did wonder if blank cells would be causing the issue, but I updated the data with dummy information to ensure there are no blank cells in the column and this still didn't work. 

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.

Top Solution Authors