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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Consecutive month actual under budget in each fiscal year

Hi Microsoft Forum Contributors and/or @tamerj1,

I'm trying to produce a measure called "Consecutive Month Under Budget" that gets its value from how many fiscal months in a row the month actual is below the month budget within a fiscal year (and then resets the calculation again for a new fiscal year).

Here's my sample data to help clarify my question:
Dimensions 1, 2, and Dim Date all have a 1 to many relationship with the fact table.
What's the best DAX to get this result? If it is easier, I can also merge the 1st and 2nd Dimension columns into the fact table so that the only 1 to many relationship the fact table has is just with the Dim Date.

Value from 1st Dimension ColumnValue from 2nd Dimension ColumnFiscal Year from DimDateFiscal Month from DimDateBudgetActualConsecutive Month Under Budget
AD2021110110
AD2021210100
AD202131091
AD202141092
AD202151083
AD2021610150
AD2021710100
AD2021810120
AD202191081
AD2021101072
AD2021111023
AD2021121084
AD2022150401
AD2022250302
AD2022350550
AD2022450600
AD2022550401
AD2022650252
AD2022750700
AD2022850401
AD2022950800
AD20221050900
AD20221150800
AD20221250401
AC2021120151
AC2021220152
AC2021320103
AC202211051
AC2022210150
AC2022310100
BC2022170101
BC2022270800
BC2022370501

 

Thanks so much in advance.

3 REPLIES 3
Anonymous
Not applicable

Okay, Thanks for your replies @Anonymous and @tamerj1
I understand that I have to provide the sample data in a tidier fashion so I will do this as soon as possible.
I was just having trouble attaching file here, what's your recommended solution for uploading file?

Anonymous
Not applicable

Hi @Anonymous,

Any update for these? It seems like you share the sample data that concatenate with multiple table fields, they did not help us to clarify your table structure.

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

tamerj1
Super User
Super User

Hi @Anonymous 
Thank you for posting this question. Please provide the sample data from each table seperately. Thank you

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.