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
Anonymous
Not applicable

Dynamic KPI measure line

Hello everybody!

I have a column based diagram, showing timelyness and target measure by months .

In 2020 year target was 85%. In 2021 year it is 90%.

How can I change my target measure, to see 85% in months before 01/01/2021 and 90% - from 01/01/2021?

 

Regards, Nikolai

1 ACCEPTED SOLUTION

Hi , @Anonymous 

You only need to add a measure as below:

 

Target = 
SWITCH ( SELECTEDVALUE ( 'Table'[Date].[Year] ), 2020, 0.85, 2021, 0.9 )

 

or

 

Target2 = 
VAR a =
    SELECTEDVALUE ( 'Table'[Date].[Year] )
RETURN
    IF ( a = 2020, 0.85, IF ( a >= 2021, 0.9 ) )

 


The result will show as below:

45.pngPlease check my sample file for more details.

 

Best Regards,
Community Support Team _ Eason
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

4 REPLIES 4
Anonymous
Not applicable

@amitchandak , unfortunately, I didn't catch, how should I change my measure "target"?

 

Anonymous
Not applicable

Hello!

Let me explain more clearly.

I'm telling about "target" measure. In 2020 it was 85% But from the beginning of 2021 it is 90%.

How can I change my measure to see 85% in 2020 and 90% in 2021 on this graph?

Безымянный.png

Hi , @Anonymous 

You only need to add a measure as below:

 

Target = 
SWITCH ( SELECTEDVALUE ( 'Table'[Date].[Year] ), 2020, 0.85, 2021, 0.9 )

 

or

 

Target2 = 
VAR a =
    SELECTEDVALUE ( 'Table'[Date].[Year] )
RETURN
    IF ( a = 2020, 0.85, IF ( a >= 2021, 0.9 ) )

 


The result will show as below:

45.pngPlease check my sample file for more details.

 

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

amitchandak
Super User
Super User

@Anonymous , The information you have provided is not making the problem clear to me. Can you please explain with an example.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

You can use time intelligence to have measure like examples

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))


Appreciate your Kudos.

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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.