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
Lovebo01
Helper I
Helper I

Show value only for the last quarter with values

Hi everyone,

 

I am trying to show the value for the last quarter selected by the user with values (non blank).

 

To show the value of the last quarter selected by the user I am using this function : 

 
Value Last Quarter =
CALCULATE([Value],
Filter('Date','Date'[Quarter]=MAX('Date'[Quarter])))
 
So I tried to use the LASTNONBLANK function but when I am using it like this :
Value Last Quarter with values =
CALCULATE([Value],
Filter('Date','Date'[Quarter]=LASTNONBLANK('Date'[Quarter],[Value])))
 
It sums all the value for all the quarter. It doesn't sum only the last quarter.
 
Do you know how to do it please ?
 
Thank you for your help,
Lovebo,
1 ACCEPTED SOLUTION

But it gave me an idea for the solution :

 

Value Last Quarter =

var _maxQuarter =MAXX(allselected('Date'),'Date'[Quarter])
var _lastQuarterWithValue = LASTNONBLANK('Date'[Quarter],[Value])
return
CALCULATE([Value],
Filter('Date','Date'[Quarter]=MIN(_maxQuarter,_lastQuarterWithValue)))
 
And this one works good ! 🙂
 
Thank you,

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Lovebo01 , try like

Value Last Quarter =
var _max =MAXX(allselected('Date'),'Date'[Quarter])
return
CALCULATE([Value],
Filter('Date','Date'[Quarter]=_max))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

But it gave me an idea for the solution :

 

Value Last Quarter =

var _maxQuarter =MAXX(allselected('Date'),'Date'[Quarter])
var _lastQuarterWithValue = LASTNONBLANK('Date'[Quarter],[Value])
return
CALCULATE([Value],
Filter('Date','Date'[Quarter]=MIN(_maxQuarter,_lastQuarterWithValue)))
 
And this one works good ! 🙂
 
Thank you,

Hello,

 

Thank you for your help but it doesn't work, I have only values for the last Quarter, but if the last quarter with some values is the 2nd quarter, it shows nothing.

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.