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
Varan_15
Helper III
Helper III

last available data based on month selection

Hi All,

 

I have calendar table and sales table so created relationship based on dates.

calendar date is used in slicer as month format , Now there is requirement if i select any month it should show that month last day of value  or if i select more month then sum of all those months last day value should show in card result.

 

EX:

sales table:

DateProductSalesetc columns..
01/01/202410160 
02/01/202410180 
31/01/202410190 
02/02/202410140 
28/02/202410126 
04/03/202410115 
31/03/202410178 
01/04/202410136 
02/04/20241015 
03/04/20241014 

 

expected result like:

if i select slicer month (jan, mar, april) then sum of last date value should show. (172)

if i select only Jan then jan month last value should show (90)

11.PNG

 

thanks in advance.

Vara

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@Varan_15 

you can try to create a column in fact table

 

Column = if('Table'[Date]=maxx(FILTER('Table',year('Table'[Date])=year(EARLIER('Table'[Date]))&&month('Table'[Date])=month(EARLIER('Table'[Date]))),'Table'[Date]),"y")
 
then create the measure
Measure = sumx(FILTER('Table','Table'[Column]="y"),'Table'[Sales])
 
11.PNG
 
pls see the attachment below
 
 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@Varan_15 

you can try to create a column in fact table

 

Column = if('Table'[Date]=maxx(FILTER('Table',year('Table'[Date])=year(EARLIER('Table'[Date]))&&month('Table'[Date])=month(EARLIER('Table'[Date]))),'Table'[Date]),"y")
 
then create the measure
Measure = sumx(FILTER('Table','Table'[Column]="y"),'Table'[Sales])
 
11.PNG
 
pls see the attachment below
 
 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan_mayu ,

 

Thanks for your quick update it's working as expected.

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.