Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I'm looking for a measure, where in we select continuous months then the measure should work , if we select the months which are not in sequential order measure should show blank value.
For eg: measure shld work when we select Jul and Aug..it shld return zero value when we select Jul and Sep.
I tried using hasonevalue function , but it works with only one month at a time.
Solved! Go to Solution.
@kkalyanrr , the logic is a bit verbose to test whether selected items are in a row; you might try this pattern, (assume your Calendar table is like this)
Test Consecutive =
VAR __mth_selected = COUNTROWS ( ALLSELECTED ( 'Calendar'[Year-Month] ) )
VAR __period = ALLSELECTED ( 'Calendar' )
VAR __mth_min = MONTH ( MINX ( __period, 'Calendar'[Date] ) )
VAR __mth_max = MONTH ( MAXX ( __period, 'Calendar'[Date] ) )
VAR __consecutive = __mth_max - __mth_min + 1 = __mth_selected
RETURN
IF ( __consecutive, "Consecutive", "Not Consecutive" )
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@kkalyanrr , the logic is a bit verbose to test whether selected items are in a row; you might try this pattern, (assume your Calendar table is like this)
Test Consecutive =
VAR __mth_selected = COUNTROWS ( ALLSELECTED ( 'Calendar'[Year-Month] ) )
VAR __period = ALLSELECTED ( 'Calendar' )
VAR __mth_min = MONTH ( MINX ( __period, 'Calendar'[Date] ) )
VAR __mth_max = MONTH ( MAXX ( __period, 'Calendar'[Date] ) )
VAR __consecutive = __mth_max - __mth_min + 1 = __mth_selected
RETURN
IF ( __consecutive, "Consecutive", "Not Consecutive" )
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!