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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
DebbieE
Community Champion
Community Champion

Target and Current Measure, splitting between dates in a visual to see change over years

say you have a single measure. Baseline Average of 50

And you have another single measure, called target of 30

these are just single figure values

 

And you have a date table. 

Is there any way of dragging in years from the date table for example 2020 2021 2022 2023 and 2024 (5 years) into a visual

 

And have some DAX that figures out how you break down the 50 on the first year in 2020 to 30 in 2025

Which is 

baselinediagram.JPG

but if you changed the number of years then the figures would update accordingly. 

 

3 years .JPG

obviously Ive gone for easy numbers here but essentially, someone could change the baseline and target figures and we could implement some DAX so we can add years in. 

 

At the moment I havent got much of a clue if it can be done. Im not actually sure of the maths at the moment so any ideas would be fantastic

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @DebbieE 

 

I use some simple data to test and get what you need. Please take the following DAX codes for reference.

 

  • Date Table:
Date = ADDCOLUMNS(CALENDAR(DATE(2020,1,1),DATE(2024,12,31)),"Year",YEAR([Date]))
  • Measures:
Baseline Measure = 50
Target Measure = 30
Value Measure = 
VAR maxYear = CALCULATE(MAX('Date'[Year]),ALLSELECTED('Date'[Year]))
VAR minYear = CALCULATE(MIN('Date'[Year]),ALLSELECTED('Date'[Year]))
VAR breakdownPart = DIVIDE([Baseline Measure] - [Target Measure], maxYear - minYear)
RETURN
[Baseline Measure] - breakdownPart * (MAX('Date'[Year]) - minYear)

 

I use a slicer to get the years from Date table. When changing the years range, the Value Measure will change accordingly. Let me know if this works at your side. Please download the PBIX.

112605.jpg

 

Best Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @DebbieE 

 

I use some simple data to test and get what you need. Please take the following DAX codes for reference.

 

  • Date Table:
Date = ADDCOLUMNS(CALENDAR(DATE(2020,1,1),DATE(2024,12,31)),"Year",YEAR([Date]))
  • Measures:
Baseline Measure = 50
Target Measure = 30
Value Measure = 
VAR maxYear = CALCULATE(MAX('Date'[Year]),ALLSELECTED('Date'[Year]))
VAR minYear = CALCULATE(MIN('Date'[Year]),ALLSELECTED('Date'[Year]))
VAR breakdownPart = DIVIDE([Baseline Measure] - [Target Measure], maxYear - minYear)
RETURN
[Baseline Measure] - breakdownPart * (MAX('Date'[Year]) - minYear)

 

I use a slicer to get the years from Date table. When changing the years range, the Value Measure will change accordingly. Let me know if this works at your side. Please download the PBIX.

112605.jpg

 

Best Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

thats fantastic,

Thank you. Just need to try and figure out how it all works now

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.