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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Alpesh
Helper I
Helper I

Target based on % inc/dec last year - but trended by month

Hi, We have a target which is to decrease by 10% from previous year.

 

I've created my target measure which works fine and using this in the Gauge visual vs. actuals: 

Target Phone AHT =
VAR TenPc = [Ave. Phone AHT - Last Year]*0.1
Return  [Ave. Phone AHT - Last Year]-TenPc
 
The challenge now comes, that we need to visual this target vs. actuals per month. And be able to filter by Country. If I use the target measure in a line chart by month, the target is taking 10% per month of the previous year. Instead it should be flat (the same number) across the year. How do I make the target ignore month context as the target should be flat. 
 
I tried adding  ALLEXCEPT YEAR in the return statement but the figures don't seem right.
1 ACCEPTED SOLUTION
v-jianpeng-msft
Community Support
Community Support

Hi, @Alpesh 

Based on your description, I've created the entire sample data below:

vjianpengmsft_0-1724205872756.png

I'm going to simulate your measure using the whole of the following: [Af. Bonn-Art-Rasteyer]

AvePhone AHT-Last Year = SUM('Table'[Ave. Phone AHT - Last Year])

Target Phone AHT:

Target Phone AHT = 
VAR TenPc = [AvePhone AHT-Last Year]*0.1
Return  [AvePhone AHT-Last Year]-TenPc

Actual measure:

EachMonth = SUM('Table'[Ave. Phone AHT - Last Year])

To keep the Target Phone AHT metric flat over the course of a year, I created a metric using the following DAX expression:

Measure = CALCULATE([Target Phone AHT],ALL('Table'[Month]))

This ignores the month context and leaves other filters such as country and year intended. Here are the results:

vjianpengmsft_1-1724206202495.png

vjianpengmsft_2-1724206213388.png

I have provided the PBIX file used this time below for your reference.

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

1 REPLY 1
v-jianpeng-msft
Community Support
Community Support

Hi, @Alpesh 

Based on your description, I've created the entire sample data below:

vjianpengmsft_0-1724205872756.png

I'm going to simulate your measure using the whole of the following: [Af. Bonn-Art-Rasteyer]

AvePhone AHT-Last Year = SUM('Table'[Ave. Phone AHT - Last Year])

Target Phone AHT:

Target Phone AHT = 
VAR TenPc = [AvePhone AHT-Last Year]*0.1
Return  [AvePhone AHT-Last Year]-TenPc

Actual measure:

EachMonth = SUM('Table'[Ave. Phone AHT - Last Year])

To keep the Target Phone AHT metric flat over the course of a year, I created a metric using the following DAX expression:

Measure = CALCULATE([Target Phone AHT],ALL('Table'[Month]))

This ignores the month context and leaves other filters such as country and year intended. Here are the results:

vjianpengmsft_1-1724206202495.png

vjianpengmsft_2-1724206213388.png

I have provided the PBIX file used this time below for your reference.

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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