Forum Discussion
ajazz
5 years agoFrequent Visitor
Dynamic Reference Line on line chart
Hi there, I was wondering if it is possible to add a dynamic reference line to a line chart. In my line chart I have some filtered products by a slicer. On the y-axis i have price and x-axis i ...
- 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!
v-kelly-msft
4 years agoCommunity Support
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
)
) + 50
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
ajazz
4 years agoFrequent Visitor
Awesome v-kelly-msft
You helped me a bunch! Thanks a lot!
- v-kelly-msft4 years agoCommunity Support
Hi ajazz ,
Glad to help!🙂
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!