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

Be 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

Reply
Honne2021
Helper II
Helper II

Tricky Dax Measure For Dynamic and Static End Dates

Hi, 

I cannot seem to find a solution to this! This is quite tricky and complicated as it involves 3 different scenarios with static and dynamic end date. 

If the cell is blank, use the date filter and the 'Start Date' but if there is a value, use that value as an end date but use the 'First Hire' date instead. I cannot turn it into a calculated column because the end date must be based on the date filter. I've attached a screenshot of the excel file as reference.. From what I read, calculated columns in power bi is static so I'm not sure if I should use one in here as the months in position is based on the date filter. 

Picture1.png

 This is similar to the post found in the link below but mine involves an end date that varies depending on the scenario.

https://community.powerbi.com/t5/Desktop/Dynamic-Age-Calculation-Based-on-User-Selected-Cutoff-Date/...





 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Honne2021 , Refer if the attached file can help on similar data

 

 

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

2 REPLIES 2
amitchandak
Super User
Super User

@Honne2021 , Refer if the attached file can help on similar data

 

 

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

Hi @amitchandak. I was close enough. I still have another issue. I have multiple rows of data on of each person. I had tried changing your code:

Count in Bucket 1 = sumx( values('Age Ranges'[Range]) ,CALCULATE(Countx(filter(Employee,[Current Age Buckets] = Max('Age Ranges'[ID]) ),[Current Age]), CROSSFILTER('Date'[Date],Employee[Start Date],None)))

and changed it from Sumx to Countx but I got just a count of all the range which is 3 (because I have 3 rows in the range dimension table). 

thank you

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

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.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.