March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a baseline date measure for project tasks and todays measure, I want an if statement that states if the date is greater than or equal to 30 days then the RAG status is green, if the date is less than 30 then it is amber, if it less than 10 days then it is red.
The measure i can is =if [Baseline Date]-[Today's Date]>=30 , ="Green", or if [Baseline Date]-[Today's Date]<=30, = "Amber" or if [Baseline Date]-[Today's Date]<=30 , ="Red")))
Am I doing something wrong, I have searched numerous forums and pages but all are coming up with either nested IF statements that do not work or other measures that don't quite fit my condition.
@knowledgesearch Not sure what else I can say based on the information you provided. Maybe share a sample pbix file using one drive/google drive and remove the sensitive information before sharing.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@knowledgesearch there was a typo, it is fixed now.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
It still says there is an error the syntax for return is incorrect
@knowledgesearch It is much easier with switch, although you can also do with IF but SWITCH is easy to read and debug.
VAR __Days = [Baseline Date]-[Today's Date]
RETURN
SWITCH ( TRUE (),
__Days >= 30, "Green",
__Days >= 10, "Amber",
"Red"
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
It is saying incorrect syntax for return, this is a calculated column measure I have a calculated column that calculates the difference between the baseline and today's date.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |