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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Urgent Help needed in Dynamic Ranking based on Date as a Measure.

Hello Dax Experts,

 

I need your urgent help!

 

First let me explain you about data.

 

I have a EmployeeTable. It consist of ID, EmployeeID , AssignementID, StartDate, EndDate, ExtensionNumber, TypeOfAssignment(Perm/Contract), HiredByOrganization, Profit/Loss. For employee, assignments also got extended. So for them there are multiple entries for employee for same assignment. 

 

Below is the user requirement:

 

User will select a SingleDate. The complete report should be running for that date. Whichever date is selected only the records which exist under below criteria should be considered.

 

StartDate> SelectedDate-60 (Should not be more then 60 days old from SelectedDate)

EndDate>=SelectedDate (Only non expired/finished Assignments)

 

For this I have created standalone table consisting date. I am picking the value of Date given by User with the help of SelectedValue function.

I have created a measure with the help of SELECTEDVALUE and when the above criteria is getting satisfied I am giving value as 1 or else blank. And I am giving this measure as a filter in my matrix or other measure using FILTER dax i.e. [Measure]>0 to fulfil above requirement and it is working completely fine.

 

I need to show the count of Employees for each Organisation in 2 categories i.e AssignmentEndingin2weeks and AssignmentEndinginmorethen2weeks (Needs to be calculated as per the Selected Date by user and AssignementEndDate). Also I need to drag Profit/Loss column in column field of my matrix.

For this I need to take the count of the Emoloyees. The above two categories of AssignmentEnding duration in weeks also depend on the Date Selected by user.

 

So first we need to create a calculated column which will be concatination EmployeeID and AssignmentID. Now we need to Rank this calculated column based on a AssignmentEndDate in descending order so that I will give this as a FILTER wherever required i.e Rank=1. I need to create it as a measure. As everything depends on the Date Selected by user Calculated Coumn will not work.

 

But I also need to take care of below criteria before giving rank.

 

StartDate> SelectedDate-60 (Should not be more then 60 days old from SelectedDate)

EndDate>=SelectedDate (Only non expired/finished Assignments)

 

I first need to fulfill above criteria and after that need to Rank. And will use this measure as Filter i.e [Measure]>0 wherever required.

 

I am badly stuck need your urgent help.

Thanks in Advance.

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

Really need to have data for this one. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Greg_Deckler ,

 

I have uploaded a sample data here.

https://uploadfiles.io/tus89lp8

 

Please let me know in case of any more information required.

Eagerly waiting for your help.

Anonymous
Not applicable

Hello @Greg_Deckler ,

 

Thanks for reply!

Will share sample data shortly.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors