Forum Discussion
Dynamic Reference Line on line chart
- 4 years ago
Hi ajazz ,
Sorry for the late reply.
Create 2 measures as below:
Average = AVERAGEX ( FILTER ( ALLSELECTED ( MedicinPriserUnpivot ), 'MedicinPriserUnpivot'[Varenummer] = MAX ( MedicinPriserUnpivot[Varenummer] ) && 'MedicinPriserUnpivot'[Dato] = MAX ( 'MedicinPriserUnpivot'[Dato] ) ), 'MedicinPriserUnpivot'[Pris] )Measure2 = VAR _tab = CALCULATETABLE ( VALUES ( 'Vareoversigt'[Varenummer] ), FILTER ( ALL ( Vareoversigt ), 'Vareoversigt'[Substitutionsgruppe] IN FILTERS ( Vareoversigt[Substitutionsgruppe] ) ) ) RETURN CALCULATE ( MINX ( ALLSELECTED ( MedicinPriserUnpivot ), [Average] ), FILTER ( ALLSELECTED ( 'MedicinPriserUnpivot' ), 'MedicinPriserUnpivot'[Dato] = MAX ( 'MedicinPriserUnpivot'[Dato] ) && 'MedicinPriserUnpivot'[Varenummer] IN _tab ) ) + 50And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!
Hi ajazz ,
I see your data,how to caculate the reference line?
I took part of your data as below:
Could you pls advise me how to get the reference line?What is the calculation logic?
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
- ajazz5 years agoFrequent Visitor
Hi again,
It needs to be average price per ProductNumber.
Then a slicer to select 3-4 productnumbers.
Of the "filtered" view, the reference line needs to take the ProductNumber with the lowest price and add +50 to it.Does that make sense?
- v-kelly-msft5 years agoCommunity Support
Hi ajazz ,
Do you mean that the reference line is combined by loweast price of each month +50?
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!
- ajazz5 years agoFrequent Visitor
It needs to be for each date point, so not month. Like lowest price productnumber from monday 15 july 2019 + 50.