Forum Discussion
Today value on line graph
- 4 years ago
Hi, Anonymous
I am back. The code in my sample is no problem. But you modified it wrong when you used it.
I used your sample, and modify it.
Try this:
Measure5 = VAR a = MAXX ( FILTER ( ALL ( 'Table' ), [Date] <= TODAY () ), [Date] ) VAR b = MINX ( FILTER ( ALL ( 'Table' ), [Date] >= TODAY () ), [Date] ) VAR c = IF ( TODAY () - a >= b - TODAY (), b, a ) RETURN IF ( SELECTEDVALUE ( 'Table'[Date] ) = c, SELECTEDVALUE ( ( 'Table'[Value] ), BLANK () ) )Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,Community Support Team _ Janey
Hi, Anonymous
According to your description, I think you can create a measure to display your desired result.
Like this:
Measure5 =
VAR a =
MAXX ( FILTER ( ALL ( 'Table 3' ), [Column1] <= TODAY () ), [Column1] )
VAR b =
MINX ( FILTER ( ALL ( 'Table 3' ), [Column1] >= TODAY () ), [Column1] )
VAR c =
IF ( TODAY () - a >= b - TODAY (), b, a )
RETURN
IF (
SELECTEDVALUE ( 'Table 3'[Column1] ) = c,
MAX ( 'Table 3'[Column2] ),
BLANK ()
)
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
- Anonymous4 years agoNot applicable
Hi,
Thanks for this.
I've used the following formula to attempt your solution:
Measure5 =
VAR a =
MAXX ( FILTER ( ALL ( 'Table' ), [Value] <= TODAY () ), [Value] )
VAR b =
MINX ( FILTER ( ALL ( 'Table' ), [Value] >= TODAY () ), [Value] )
VAR c =
IF ( TODAY () - a >= b - TODAY (), b, a )
RETURN
IF (
SELECTEDVALUE ( 'Table'[Value] ) = c,
MAX ( 'Table'[Value] ),
BLANK ()
)but still blank values. Any advice on this would be greatly appreciated.
- v-janeyg-msft4 years ago
Community Support
Hi, Anonymous
I am back. The code in my sample is no problem. But you modified it wrong when you used it.
I used your sample, and modify it.
Try this:
Measure5 = VAR a = MAXX ( FILTER ( ALL ( 'Table' ), [Date] <= TODAY () ), [Date] ) VAR b = MINX ( FILTER ( ALL ( 'Table' ), [Date] >= TODAY () ), [Date] ) VAR c = IF ( TODAY () - a >= b - TODAY (), b, a ) RETURN IF ( SELECTEDVALUE ( 'Table'[Date] ) = c, SELECTEDVALUE ( ( 'Table'[Value] ), BLANK () ) )Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,Community Support Team _ Janey