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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ThomasWeppler
Skilled Sharer
Skilled Sharer

How do I make sure a max formula is affected by my date filter?

Hi Power Bi community
I have a table which contains the status of diffrent projects at diffrent times.
It look like this.

ThomasWeppler_0-1660740093776.png

I want to find the last stateid based on the date and todoid.
So I use a Dax formular like this.
Luckly a higher id always means a later date so I can use this Dax code.

Status IGA =
var _maxid = MAX(Todostatehistory[id])
return
LOOKUPVALUE(Todostatehistory[stateid], Todostatehistory[id], _maxid)

When I place it in a table it will only look at the relevent todoid. 
However I also has a filter which filter on the highestdate based on the date., but it doesn't seem to affect my dax code.

So my question is what can I do to make sure my Dax is affected by my Date filter?



1 ACCEPTED SOLUTION

@Greg_Deckler 
Ok I found the problem.
I used a calender table so one slicer could affect multiple tables.

But the date colum in my table was thype = time date/ time while my calender table colum hads the type = date.

Thanks a lot for the help Greg, sometimes you just need the right question to start thinking in a new way.
A moderator can close this thread.

View solution in original post

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @ThomasWeppler ,

 

Glad to hear that your problem has been solved. Could please mark your reply as a solution and then more people will benefit from it.

 

Best Regards,

Stephen Tao

Greg_Deckler
Super User
Super User

@ThomasWeppler If you are using your Dato column as your date filter then assuming this is a slicer or something in the Filter pane then this should already be filtering your rows in that table. Is that what you are doing or something else?


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 
Ok I found the problem.
I used a calender table so one slicer could affect multiple tables.

But the date colum in my table was thype = time date/ time while my calender table colum hads the type = date.

Thanks a lot for the help Greg, sometimes you just need the right question to start thinking in a new way.
A moderator can close this thread.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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