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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
AllanBerces
Post Prodigy
Post Prodigy

IF or Switch

Hi good day can anyone assist me on my query. I have table, I want the Stutus
"Not Startted" if the date is in coming or in futere
"Delayed" if the date already pass on the end date and the progress is lessthan 100%
"In-progress" if the progress is lessthan 100% and the current date not exceed on the end date

"Completed" if already 100% in Remark column

AllanBerces_0-1720881370720.png

OUTPUT

AllanBerces_1-1720881407442.png

Thank you

 

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @AllanBerces 
You can create a calculated column with the dax :

Status =
if('Table'[Remarks]=1,"Completed",
If ([P1 Sta]>=TODAY(),"Not started",
if ('Table'[Remarks]<1 && 'Table'[P1 En]<TODAY(),"Delayed",
if('Table'[Remarks]<1 &&'Table'[P1 En]>=TODAY(), "In progress")
)))
Ritaf1983_0-1720883637149.png

The pbix is attached

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

4 REPLIES 4
Chakravarthy
Resolver II
Resolver II

Hi @AllanBerces 
Try this Code

 

Status =
VAR _START = 'Table'[P1 Start]
VAR _END = 'Table'[P1 End]
VAR _PRO = 'Table'[Remarks]
VAR _Result =
SWITCH(TRUE(),
_START>=TODAY(),"Not Started",
_PRO=1 && _END<=TODAY(),"Completed",
_PRO<1 && _END<TODAY(),"Delayed",
_PRO<1 && _END>=TODAY(),"In-Progress",
"NO STATUS UPDATE"
)

RETURN _Result
Ritaf1983
Super User
Super User

Hi @AllanBerces 
You can create a calculated column with the dax :

Status =
if('Table'[Remarks]=1,"Completed",
If ([P1 Sta]>=TODAY(),"Not started",
if ('Table'[Remarks]<1 && 'Table'[P1 En]<TODAY(),"Delayed",
if('Table'[Remarks]<1 &&'Table'[P1 En]>=TODAY(), "In progress")
)))
Ritaf1983_0-1720883637149.png

The pbix is attached

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi @Ritaf1983 @Chakravarthy  thank you for the help, working great.

Happy to help 🙂

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.