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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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