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.
Hi,
I find this weird but I may be doing it wrong.
Basically, what I am trying to accomplish is get the max date in the date table which is filtered to start from 1/1/17 until date today (done using DateTime.Date(DateTime.LocalNow()) function). If the date today is 7/18/17, the max date should be that date but the result of my DAX formula is 12/31/17.
The following are the formulas I'm using:
MaxDate = MAX ( Calendar[Date].[Date] ) MaxDate with Calculatte = CALCULATE ( MAX ( Calendar[Date].[Date] ), ALL ( Calendar ) )
Proud to be a Super User!
Solved! Go to Solution.
Thanks for the response but as mentioned, my calendar table's maximum value is the current date so it should be 7/18.
But I've figured out where I went wrong. By adding a .[Date] after Calendar[Date], the measure uses the hidden table created by PBI desktop's time intelligence featture. Removing .[Date] solves the problem.
Proud to be a Super User!
Hi @danextian,
The question is that you are using the ALL and by doing that you discard all the filter you have on the Calendar date and return the maximum value of the full table ignoring all the rest of the filters you need to do something like this:
MaxDate with Calculatte ALLSELECTED = CALCULATE ( MAX ( Calendar[Date] ), ALLSELECTED ( 'Calendar'[Date] ) )
As you can see below I have made a print with your two formulas and mine with a slicer see the result:
Regards,
Mfelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português
Thanks for the response but as mentioned, my calendar table's maximum value is the current date so it should be 7/18.
But I've figured out where I went wrong. By adding a .[Date] after Calendar[Date], the measure uses the hidden table created by PBI desktop's time intelligence featture. Removing .[Date] solves the problem.
Proud to be a Super User!
Thanks @danextian . Sometimes a big problem can be solved with simple solutions. Your suggestion here made my day peaceful.
Hi @mbm ,
This was from my early DAX days when I was still a newbie and not yet a super user.
Proud to be a Super User!
Hi @danextian,
Thanks for your sharing. Please kindly mark the corresponding resolution as an answer so that it can benefit more users.
Thanks,
Yuliana Gu
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |