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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors