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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
storgall
Frequent Visitor

How to show percentage on chart based on first value in the chart

I'm trying to make a line chart similar to this one:

storgall_0-1662110639713.png

 

My data looks like this:

DatesProductPrice
1.1.2020Product1Price of Product1 in Jan 2020
1.2.2020Product1Price of Product1 in Feb 2020
...  
1.9.2022Product1Price of Product1 in Sep 2022
1.1.2020Product2Price of Product2 in Jan 2020
1.2.2020Product2Price of Product2 in Feb 2020
...  
1.1.2020Product3Price of Product3 in Jan 2020
1.2.2020Product3Price of Product3 in Feb 2020

 

I'm trying to achieve this by creating a measure that calculates the first selected month's values and then dividing the values by this measure. I'm getting this measure only for the first month (as if I were using KEEPFILTERS, as in this video https://www.youtube.com/watch?v=HxZLkmpY6BA&t=485s at 8:05 - 9:15).

 

The measure:

FirstValue =
Var FirstDate1 = MINX(ALLSELECTED(Merge1[Dates]),Merge1[Dates])
Var FirstPrice = CALCULATE(SUM(Merge1[Price]), 'Merge1'[Dates] = FirstDate1)
RETURN FirstPrice
 
My chart:
light blue = Price
dark blue = FirstValue measure (the dot only on the first month)
orange = the percentage (1 or 100% for first, infinity for others)
storgall_1-1662111395240.png

I want to show only the orange line after it works.

 

 

What am I doing wrong?

 

Thank you for any help!

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi  @storgall ,

Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.

Best Regards
Lucien

lbendlin
Super User
Super User

Please provide meaningful sample data.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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