cancel
Showing results for
Did you mean:
Post Patron

How to get December values of each year and latest current month of the year

Hi,

Would really need your help in creating a dax. I have a 6 years worth of data (cummulative) from 2017 to 2022 and it's on a monthly view.

Need your help in creating a dax to display the december values of each year and the current month available month for 2022.

Thank you so much in advance!

6 REPLIES 6
Community Support

Hi, @icdns ;

Is your problem solved? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support

Hi， @icdns ；

Sorry, I don't fully understand your original data model and the results you want to output, quarterly and monthly. Can you share a simple file or more information?

Community Support

Hi, @icdns ;

You could create a measure as follows:

``````Measure =
var _max=CALCULATE(MAX('Table'[Date]),ALL('Table'))
return IF(NOT( ISINSCOPE('Table'[Date].[Month])),
CALCULATE(SUM([value]),FILTER('Table',MONTH([Date])=12 || EOMONTH([Date],0)=EOMONTH(_max,0))))``````

The final output is shown below:

Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Post Patron

Thank you for this. However, it is not working properly if I dril down to QUARTER and MONTHLY. Is it possible to include it in the dax? I am using a dimension date table.

Thank you so much in advance!

Super User

@icdns , Create a column year month in Table YYYYMM

and with help from date tbale

calculate(LASTNONBLANK(Table[Year Month], Sum(Table[Value])), allexcept('Date', 'Date'[year]))

Try like

calculate(Sum(Table[Value]), filter(allseleceted('Date'), 'Date'[year] = max(Date[Year]) ), filter(Table, month(Table[Date]) = calculate( month(Max(Table[Date])),filter(allseleceted('Date'), 'Date'[year] = max(Date[Year]) ))))

Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!
Post Patron

hi @amitchandak ,

Thank you, the formula is now displaying the december values of each year. But it doesn't display the latest current month of the year value 😞 How can I tweak the dax?

Ex:

In below example, it's displaying the value for 2017 to 2021 but not 2022.

Thank you so much for your help!!

Announcements