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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
HectorMSC
Frequent Visitor

How to apply a dynamic formula?

Hello! I hope everyone is doing well. Today, I'd like some assistance about a crucial aspect of inventory management: the BOM (Beginning of Month) formula. The BOM formula plays a vital role in helping businesses effectively manage their inventory and avoid overstocks.

BOM (Beginning of Month) Formula: BOM = MonthPlan + (AnnualPlan) * ((1/Rot) - (1/12))

  • MonthPlan: This represents the monthly sales plan. It reflects the expected sales for a particular month.

  • AnnualPlan: The AnnualPlan refers to the annual sales plan.

  • Rot (Rate of Turnover): Rot is a crucial parameter that indicates how quickly inventory turns over during the year. 

    HectorMSC_0-1695078843329.png

    For example, January should be:
    351,710.26 + (5,140,233.08)((1/6)-(1/12)) = 780,063.

    Febreaury should be:
    355283.55 + (5,140,233.08)((1/6)-(1/12)) = 783,636 and so on.

    Right now my formula is: 

 

BOM Plan = 
VAR FirstMonthPlan = CALCULATE(
    SUMX('Dashboard', [Plan]),
    FILTER('Dashboard', 'Dashboard'[Month] = 01)
)

VAR AnnualSalesPlan = CALCULATE(
    SUMX('Dashboard', [Plan]),
    ALLEXCEPT('Dashboard', 'Dashboard'[Year])
)

RETURN
SUMX(
    'Dashboard',
    VAR Rot = [Rot]
    RETURN
    FirstMonthPlan + (AnnualSalesPlan * (1 / (Rot - 1/12)))
)

And I'm getting this:
HectorMSC_2-1695079547638.png

 

Thanks in advance for any assistance!

 

 

 

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@HectorMSC 

BOM Plan Measure = 
VAR __MonthPlan = [Plan] --assuming this is a measure which is sum ( Table[Plan] )
VAR __AnnualPlan = CALCULATE ( [Plan], ALLSELECTED ( Table[Months] ) ) --month column shown on the column in the matrix visual
VAR __Rot = [ROT] --assuming it is a measure
VAR __Result = __MonthPlan + ( __AnnualPlan * ( 1 / ( __Rot - 1 / 12 ) ) )
RETURN
    __Result


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
parry2k
Super User
Super User

@HectorMSC glad you have the solution. Cheers!!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@HectorMSC 

BOM Plan Measure = 
VAR __MonthPlan = [Plan] --assuming this is a measure which is sum ( Table[Plan] )
VAR __AnnualPlan = CALCULATE ( [Plan], ALLSELECTED ( Table[Months] ) ) --month column shown on the column in the matrix visual
VAR __Rot = [ROT] --assuming it is a measure
VAR __Result = __MonthPlan + ( __AnnualPlan * ( 1 / ( __Rot - 1 / 12 ) ) )
RETURN
    __Result


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hello @parry2k !
Thanks for the code, I just used the code you provide but I had a problem with the AnnualPlan, because it was selecting the monthly plan, not the sum of every month.

However, I create a column called "Total Plan Year"

Total Plan Year = 
SUMX(
    FILTER('Dashboard', 'Dashboard'[Year] = 2022),
    'Dashboard'[Ventas Total] * 1.3
)

 

And I used your code:

BOM Plan Measure = 
VAR __MonthPlan = [Plan] --assuming this is a measure which is sum ( Table[Plan] )
VAR __AnnualPlan =
AVERAGE(Dashboard[Total Plan Year])
VAR __Rot = [RotM] --assuming it is a measure
VAR __Result = __MonthPlan + ( __AnnualPlan * (( 1 / __Rot) - 1 / 12) )
RETURN
    __Result

 

HectorMSC_0-1695136332231.png


Now I have what I was looking for, thank you!

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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