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
Ritaf
Responsive Resident
Responsive Resident

Calculation for dynamic target based on hystorical data

Hi ,

I am trying to calculate dynamicly a target of some percentage of economy rate for purchase managers. For this calculation i am trying to get the monthly purchase sum, the part of this sum from year's total purchace and an averge monthly percent by years (excluding current year, because it is not comlpete).

For calculate an nomthly purchase sum ia used an dax formula :

CALCULATE([sumPurchase$],ALLEXCEPT(dimDate,dimDate[monthYear]),FILTER(dimDate,[year]<>[this year])) and it seem working
For yearly total i triying :
full_year_purchase = CALCULATE([[sumPurchase$],ALLEXCEPT(dimDate,dimDate[year])),
the problem is that it calculates the sum of all years and not year by year, how can i solve it? And how can a imake all this calculates without slicers effect? I just want to put an target in percent of purchase and to know on every day what my Execution rate
 based on hystory of all years exclude current.
Thanks a lot , Rita
2 ACCEPTED SOLUTIONS
Ritaf
Responsive Resident
Responsive Resident

unfortinately this isn't working, "this year" is not an issue, the problem is thtat the measure not calculating an year's sum , it isshowing me an monthly sum. I attached i picture Presentation3.jpg

 

View solution in original post

Do you need that year sales

Year Sales = CALCULATE(TOTALYTD(sum(Sales[Sales Amount]),ENDOFYEAR('Date'[Date Filer])))

This Will not give for this year(Incomplete year)

Year Sales = 
Var _this_year = year(TODAY())
return
 CALCULATE(TOTALYTD(sum(Sales[Sales Amount]),ENDOFYEAR('Date'[Date Filer]),ABS(year(Sales[Sales Date]) <> _this_year)))

Screenshot 2019-10-20 13.25.39.png

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

Will less than current year will not work for you

 

CALCULATE([sumPurchase$],FILTER(dimDate,[year]<[this year]))

Or
CALCULATE([sumPurchase$],dimDate[year]<[this year])

 

 

I am assuming This Year is calculated as Var in formula

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Ritaf
Responsive Resident
Responsive Resident

unfortinately this isn't working, "this year" is not an issue, the problem is thtat the measure not calculating an year's sum , it isshowing me an monthly sum. I attached i picture Presentation3.jpg

 

Do you need that year sales

Year Sales = CALCULATE(TOTALYTD(sum(Sales[Sales Amount]),ENDOFYEAR('Date'[Date Filer])))

This Will not give for this year(Incomplete year)

Year Sales = 
Var _this_year = year(TODAY())
return
 CALCULATE(TOTALYTD(sum(Sales[Sales Amount]),ENDOFYEAR('Date'[Date Filer]),ABS(year(Sales[Sales Date]) <> _this_year)))

Screenshot 2019-10-20 13.25.39.png

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Ritaf
Responsive Resident
Responsive Resident

Thanks a lot it is working!!! could ypu explain me a logic of this solition step by step?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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