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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
kodnil2020
Helper I
Helper I

DAX formation for date

Hello,

 

Need help on forming DAX for finding employees with start date is less than or equal to 31 Jan of current month.

 

'Employee Details'[StartDate] <= 01/31/{Year(today()}

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@kodnil2020 ,

Try in a new column

 

'Employee Details'[StartDate] <=date(year(today()),1,31) 
Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

v-alq-msft
Community Support
Community Support

Hi, @kodnil2020 

 

Based on your description, I assume that you want to filter out employees whose start date is less than or equal to31 Jan of current year. I created data to reproduce your scenario. The pbix file is attached in the end.

 

Employee Details:

d1.png

 

You may create a measure as below.

Visual Control = 
IF(
   SELECTEDVALUE('Employee Details'[Start Date])<=DATE(YEAR(TODAY()),1,31),
   1,0
)

 

Then you need to put the measure in the visual level filter to get the result.

d2.png

 

Best Regards

Allan

 

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

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @kodnil2020 

 

Based on your description, I assume that you want to filter out employees whose start date is less than or equal to31 Jan of current year. I created data to reproduce your scenario. The pbix file is attached in the end.

 

Employee Details:

d1.png

 

You may create a measure as below.

Visual Control = 
IF(
   SELECTEDVALUE('Employee Details'[Start Date])<=DATE(YEAR(TODAY()),1,31),
   1,0
)

 

Then you need to put the measure in the visual level filter to get the result.

d2.png

 

Best Regards

Allan

 

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

amitchandak
Super User
Super User

@kodnil2020 ,

Try in a new column

 

'Employee Details'[StartDate] <=date(year(today()),1,31) 
Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
kodnil2020
Helper I
Helper I

This is what i tried so far:

FORMAT(01/31/YEAR(TODAY()), "mm/dd/yyyy")

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.