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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
TolgaOzpirildak
New Member

if current date is among 2 dates power bi condition for multiply dates

Hi all,

I am trying to add conditional column between 2 dates but could not figuure it out.

 

If the current date is 8/24/2023, I expect it to write "Yes" to all data before 8/10/2023 with "No" from 8/10/2023 to 9/15/2023

When my date is 9/15/2023 in the future, it will write "No" on 9/15/2023 and "Yes" on all dates before it (until the next date 10/11/2023)

Is there any way to make it?

 

TolgaOzpirildak_0-1692912168631.png

 

I have tried that one but did not work and It typed "No" starting from  7/12/2023. (Also I have changed the order but nothing changed)

TolgaOzpirildak_2-1692912808365.png

 

 

Thank you everyone for your helps.

7 REPLIES 7
parry2k
Super User
Super User

@TolgaOzpirildak could you please make it easy and layout how your data will (is) look like? Why would I assume something that will not work?



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.

parry2k
Super User
Super User

@TolgaOzpirildak either I'm having some issue understanding it or you are making it super complicated. You are using the cut-off date in your example? Which column you are referring to? In your sample data, it doesn't exist. Can you be more precise and clear, or maybe I'm unable to understand?



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.

Every day new entries adding to my data entry column from SQL database. I got these cut off dates from finance and want to use them on my formula.I mean I will add 1 more column there and if my data entry column dates are being among this cutoff dates It will be No other entries will be Yes because of their dates. My cut off date is not on sample data because I want to use them on my formulas or Maybe I can add them as query.

 

Thanks

parry2k
Super User
Super User

@TolgaOzpirildak your reply is super confusing, can you put sample data with the logic?



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.

Of course. Here is my data:

TolgaOzpirildak_0-1692922466896.png

 I want to see this results:

 

TolgaOzpirildak_1-1692923071094.png

 

I hope it was clear enough. Thank you again.

parry2k
Super User
Super User

@TolgaOzpirildak add a new column in PQ:

 

 

if [WorkDate] < Date.From(DateTime.LocalNow()), "Yes", "No" )

 



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.

Parry2k thanks for your reply.

But I want to be based on cutoff dates Please forget about workdate. And if the current date is between the cutoff dates, I want the data in that range to be "No" and the data corresponding to the whole date before to be "Yes". In the future, my current date will fall into another range and "No" will be "Yes" because it is old date. and it will continue like this live.

Thus, as the date progresses, Yes and numbers will change according to the cut off date range entered. Previous date ranges will always be "Yes" and the entered range will always be "No"

Again thank you for your efforts.

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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