Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Rolling target details Power Bi

Hi, Kindly help me the below formula in power Bi, I am new to Power Bi.
  • tharunkumarRTK's avatar
    tharunkumarRTK
    2 years ago

    Anonymous 

    Below is the sample data that I have prepared:

    Today is Sept 1st 2024. So, the Target value as per your formula and as per your fiscal calendar is (Q1  + July + Aug + Sept) 

    Formula:

    Target (On This Month) 2 = 
    Var __CurrentDay = TODAY()
    Var __CurrentMonth = MONTH(EOMONTH( __CurrentDay,-3)) 
    Var __CurrentQuarter = INT( DIVIDE(__CurrentMonth,3)) 
    Var __CurrentYear = YEAR(__CurrentDay)
    Var __NoOfMonths = 3 - INT(MOD(__CurrentMonth,3)) 
    Var __FirstMonthInQuarter = __CurrentMonth - (__NoOfMonths - 1) 
    Var __QuarerTotal = CALCULATE(SUM('Target 2'[Annl Target]), INT( RIGHT('Target 2'[Qtr]) ) < __CurrentQuarter && 'Target 2'[Year] = __CurrentYear) 
    Var __MonthTotal = CALCULATE(SUM('Target 2'[Annl Target]), 'Target 2'[MonthNum] >= __FirstMonthInQuarter && 'Target 2'[MonthNum] <= __CurrentMonth && 'Target 2'[Year] = __CurrentYear)
    RETURN __QuarerTotal + __MonthTotal  

     

    I am attaching the PBIX file.

     

    P.S. Please provide complete details in your post, along with sample data and expected result. So that community members can help you better. 

     

    Need a Power BI Consultation? Hire me on Upwork

     

     

     

    Connect on LinkedIn

     

     

     








    Did I answer your question? Mark my post as a solution!
    If I helped you, click on the Thumbs Up to give Kudos.

    Proud to be a Super User!