The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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)
Solved! Go to Solution.
It seems Power BI needed an update, and then my original statement worked again.
Thank you for the time taken to review.
It seems Power BI needed an update, and then my original statement worked again.
Thank you for the time taken to review.
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
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
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.