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

Rolling target details Power Bi

Hi,

Kindly help me the below formula in power Bi, I am new to Power Bi.

Sudhakar1000_0-1725104805698.png

1 ACCEPTED SOLUTION

@Anonymous 

Below is the sample data that I have prepared:

Screenshot 2024-09-01 at 9.17.18 AM.png

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

Screenshot 2024-09-01 at 9.18.48 AM.png

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!


PBI_SuperUser_Rank@2x.png

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Thank you so much Tharun, now its working fine

tharunkumarRTK
Super User
Super User

@Anonymous 

 

Please elaborate your question and provide sample data and expected output details. Read the instructions here please:         How to Get Your Question Answered Quickly               

 

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!


PBI_SuperUser_Rank@2x.png
Anonymous
Not applicable

HI Tharun,

Thank you for replying, 

I have two table, one Sales target, second table is Actual, So now i need target as on today same like Actual also, here below target i have attached formula. 

For Exm: Now We are there in Q2 3 month So i need Q1+M1(30%)+M2(35%)+M3(35%)  if i am there in Oct then Q1+Q2+M1(30%),  Sudhakar1000_0-1725104805698.png

@Anonymous 

 

Based on my understanding, below formula will work for your requirement:

 

Screenshot 2024-08-31 at 10.26.35 PM.png

 

 

Target (On This Month) = 
Var __CurrentMonth = MONTH(TODAY()) 
Var __Quarter = INT( DIVIDE(__CurrentMonth,3)) 
Var __NoOfMonths = INT(MOD(__CurrentMonth,3)) 
Var __QuarerTotal = 
                    SWITCH(
                        TRUE(),
                         __Quarter = 1, 0,
                         __Quarter = 2, Target[Q1(22%)],
                         __Quarter = 3, Target[Q1(22%)] + Target[Q2(26%)],
                         __Quarter = 4, Target[Q1(22%)] + Target[Q2(26%)] + Target[Q3(26%)]
                         )
Var __MonthTotal = 
                    SWITCH(
                        TRUE(),
                        __NoOfMonths = 0, Target[Month 1(30%)] + Target[Month 2(35%)] + Target[Month 3(35%)],
                        __NoOfMonths = 1, Target[Month 1(30%)],
                        __NoOfMonths = 2, Target[Month 1(30%)] + Target[Month 2(35%)]
                    )
RETURN __QuarerTotal + __MonthTotal
  

 

 

 

 

I am attaching the PBIX for your reference:

 

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!


PBI_SuperUser_Rank@2x.png

 

 

Anonymous
Not applicable

HI Tharun,

i have attached my table details, Kindly help me

Sudhakar1000_0-1725124311320.png

 

@Anonymous 

Below is the sample data that I have prepared:

Screenshot 2024-09-01 at 9.17.18 AM.png

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

Screenshot 2024-09-01 at 9.18.48 AM.png

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!


PBI_SuperUser_Rank@2x.png

 

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.