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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

get the last day sale of every month

Hi, I want to get the last day sale of each month from a date table as DimDate and a Fact Table with all aggregates. anyone kindly hlep me how to achieve this. i have tried Calculate(sum( FactTable[TotalSales]), LastDate(Dimdate[DateColumn]). 

it is giving me the total sales of each month but not the sales of last date of each month. 

Your ideas on this will be highly regarede.

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi  HumzaIftikhar,

 

Try this measure

lastday total =

    CALCULATE(SUM('Fact Table'[Sales]),FILTER('Fact Table','Fact Table'[Date]=ENDOFMONTH('Fact Table'[Date])))

 

You can try it with the demo I provided, please let me know if you have any questions.

 

Best Regards!

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-chenwuz-msft
Community Support
Community Support

Hi  HumzaIftikhar,

 

Try this measure

lastday total =

    CALCULATE(SUM('Fact Table'[Sales]),FILTER('Fact Table','Fact Table'[Date]=ENDOFMONTH('Fact Table'[Date])))

 

You can try it with the demo I provided, please let me know if you have any questions.

 

Best Regards!

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

Do these measures work?

Total = SUM(Data[Balance])

Balance on last date = CALCULATE([Total],LASTNONBLANK('DimDate'[DateColumn],CALCULATE([Total]))))

To the visual, ensure that you drag the Month name from the DimDate table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur , Thanks for being here. i tried this measure but it is giving me the same results. Here is a screen shot of that output. i want the sale of lastday of each month but it is giving me the total sale of each month. 

HumzaIftikhar_0-1630464920202.jpeg

 

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.