Forum Discussion
Previous Non-Blank Quarter
bubbledep Try using
VAR CurrentQuarter = MAX(_dCalendar[Quarter])
VAR PreviousNonBlankQuarter =
CALCULATE(
MAX(_dCalendar[Quarter]),
FILTER(
ALLSELECTED(_dCalendar[Quarter]),
_dCalendar[Quarter] < CurrentQuarter &&
NOT(ISBLANK([YourMeasure]))
)
)
RETURN
IF(
ISBLANK(PreviousNonBlankQuarter),
BLANK(),
PreviousNonBlankQuarter
)
Hi, didn't worked. It appears BLANK() to every Quarter, from here:
IF(
ISBLANK(PreviousNonBlankQuarter),
BLANK(),
PreviousNonBlankQuarter
)
- Anonymous1 year agoNot applicable
Hi bubbledep
Thank you for reaching out to the Microsoft Fabric Forum Community.
Add a quarterkey column in your calendar table using below DAXQuarterKey = YEAR([Date]) * 10 + [QuarterNumber]
Then use this DAX it may help you.
PrevNonBlankQuarter :=
VAR CurrentQKey = MAX(_dCalendar[QuarterKey])
VAR HasEarlierQuarter =
CALCULATE (
COUNTROWS (
FILTER (
ALLSELECTED (_dCalendar),
_dCalendar[QuarterKey] < CurrentQKey
)
)
)
VAR PrevNonBlankQKey =
CALCULATE (
MAX ( _dCalendar[QuarterKey] ),
FILTER (
ALLSELECTED (_dCalendar),
_dCalendar[QuarterKey] < CurrentQKey &&
NOT ISBLANK ( [YourMeasure] )
)
)
RETURN
IF (
HasEarlierQuarter = 0,
BLANK(),
CALCULATE (
SELECTEDVALUE ( _dCalendar[Quarter] ),
_dCalendar[QuarterKey] = PrevNonBlankQKey
)
)
If this information is helpful, please “Accept as solution” to assist other community members in resolving similar issues more efficiently.
Thank you.- Anonymous1 year agoNot applicable
Hi bubbledep
I hope the information provided was helpful. If you still have questions, please don't hesitate to reach out to the community.