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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

DAX or M for efficiency - Staff Database

Hi!

I have a timesheet database I'm trying to make more efficient.  A cut down version is attached.

 

"staff" will contain information about the staff member (just has a resource ID no at the moment for this cut down trial)

"staff rates" has a list of all the staff.  A grade may change over time as they get more experienced (this additional item which was originally in Staff as a single entry is what is complicating matters!)

"client rates" is what we bill out

"timesheet" is just a list of timesheet entries.

 

If there's a couple of hundred people booking, the timesheet extract will be very full with hundreds/thousands of entries.  At present we do not deal with grade changes, but now need to take this into account (what was simple is now vastly more complicated!)

 

Previously we've imported the rate into the timesheets at import, the import takes a very long time and I suspect this is because of it, but I'm not sure how I can lookup the data using a measure with this odd layout which I'd assume would be much quicker for this sort of thing.

 

timneo_0-1628683713930.png

https://www.dropbox.com/s/ekrl2nqgmeum59g/example%20timesheet.xlsx?dl=0

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

So I've used MAX for the lookup to get the value as a helper column and then the rate from there.  I realised the duff data I put in for the example made no logical sense, so adjusted some of the timesheet and grade dates to occur in the past. 

 

timneo_0-1628688280175.png

 

Is this just the easiest way of doing it, or is there a more efficient way?

View solution in original post

7 REPLIES 7
CNENFRNL
Community Champion
Community Champion

Since bi-directional filtering isn't available for you in Excel, you may want to resort to expanded table for invert filter propagation from * to 1 end.

Expanded tables in DAX - SQLBI  


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

Thanks CNENFRNL, would that be quicker than the proposed solution of using a couple of calculated columns using the DAX MAX function?  I can't quite see how it would help me because of the multiple rate problem I'm trying to address - it seems to essentially be flattening the table.

Greg_Deckler
Community Champion
Community Champion

@Anonymous Well you could use LOOKUPVALUE or MAXX(FILTER(...),...). Or, if you changed a couple of your relationships to Both you would have a filter pathway between timesheets and rates tables.



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

So I've used MAX for the lookup to get the value as a helper column and then the rate from there.  I realised the duff data I put in for the example made no logical sense, so adjusted some of the timesheet and grade dates to occur in the past. 

 

timneo_0-1628688280175.png

 

Is this just the easiest way of doing it, or is there a more efficient way?

Anonymous
Not applicable

Hey Greg - stupid question, how do you change the direction to both? Not something I've come across.  A quick google isn't coming up, so I obviously don't know what keyword to search for!

Anonymous
Not applicable

ah, looking at this, I think this is PowerBI only, not excel specific, so can't seem to do that 🙂 

@Anonymous Ah, shoot, yeah I don't do much in Excel. In Desktop you doubleclick the relationship and switch it.



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...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.