Forum Discussion
Anonymous
7 years agoNot applicable
Linear Reference Line from zero to a given target value
Hello All, how can I insert a linear trendline from zero to a pre-defined (max) value? Lines are: green: running total last year blue: running total this year red: target for this year ...
- Anonymous7 years ago
Hi Anonymous,
You can write a measure to calculate out correspond value as 'reference line', then drag it to value field to achieve your requirement:
Reference = VAR _current = SELECTEDVALUE ( 'Sample'[Index] ) VAR _min = 0 VAR _max = MAXX ( ALLSELECTED ( 'Sample' ), [Amount] ) RETURN IF ( _current = MINX ( ALLSELECTED ( 'Sample'[Index] ), [Index] ), 0, _current * _max / COUNTROWS ( ALLSELECTED ( 'Sample' ) ) )If you still confused on coding formula, please share some sample data for test.
Regards,Xiaoxin Sheng
surajbh
Helper I
4 years agoAnonymous I was using the solution as above mentioned.
If you have .pbix file, would appreciate it. if not then I have to create sample data to show why the above formula is not working on my side.
thank you in advance for the support.