Forum Discussion
Line chart slicer
- 9 years ago
Hi AntonioTG,
If I understanding correctly, the line chart displays three lines by default without any selection, and if you select a specific value from slicer, this chart should be automatically updated with only the line based on selection.
Below is my test, please review it.
Create an extra table which includes one column to list the available selections in slicer.
Create three measures that will be added into "Value" field of the LineChart. You should change the column name ('total per row[expected]', 'total per row[atual]', 'total per row[Amount]') according to your own scenario.
Value1 = IF ( LASTNONBLANK ( 'Select'[Select], 1 ) = "Value1", LASTNONBLANK ( 'total per row'[expected], 1 ), IF ( ISFILTERED ( 'Select'[Select] ) = FALSE (), LASTNONBLANK ( 'total per row'[expected], 1 ), BLANK () ) ) Value2 = IF ( LASTNONBLANK ( 'Select'[Select], 1 ) = "Value2", LASTNONBLANK ( 'total per row'[atual], 1 ), IF ( ISFILTERED ( 'Select'[Select] ) = FALSE (), LASTNONBLANK ( 'total per row'[atual], 1 ), BLANK () ) ) Value3 = IF ( LASTNONBLANK ( 'Select'[Select], 1 ) = "Value3", LASTNONBLANK ( 'total per row'[Amount], 1 ), IF ( ISFILTERED ( 'Select'[Select] ) = FALSE (), LASTNONBLANK ( 'total per row'[Amount], 1 ), BLANK () ) )I can get the expect line if I select "Value2".
Best regards,
Yuliana Gu
Hi AntonioTG,
If I understanding correctly, the line chart displays three lines by default without any selection, and if you select a specific value from slicer, this chart should be automatically updated with only the line based on selection.
Below is my test, please review it.
Create an extra table which includes one column to list the available selections in slicer.
Create three measures that will be added into "Value" field of the LineChart. You should change the column name ('total per row[expected]', 'total per row[atual]', 'total per row[Amount]') according to your own scenario.
Value1 =
IF (
LASTNONBLANK ( 'Select'[Select], 1 ) = "Value1",
LASTNONBLANK ( 'total per row'[expected], 1 ),
IF (
ISFILTERED ( 'Select'[Select] ) = FALSE (),
LASTNONBLANK ( 'total per row'[expected], 1 ),
BLANK ()
)
)
Value2 =
IF (
LASTNONBLANK ( 'Select'[Select], 1 ) = "Value2",
LASTNONBLANK ( 'total per row'[atual], 1 ),
IF (
ISFILTERED ( 'Select'[Select] ) = FALSE (),
LASTNONBLANK ( 'total per row'[atual], 1 ),
BLANK ()
)
)
Value3 =
IF (
LASTNONBLANK ( 'Select'[Select], 1 ) = "Value3",
LASTNONBLANK ( 'total per row'[Amount], 1 ),
IF (
ISFILTERED ( 'Select'[Select] ) = FALSE (),
LASTNONBLANK ( 'total per row'[Amount], 1 ),
BLANK ()
)
)I can get the expect line if I select "Value2".
Best regards,
Yuliana Gu
Hi
Thanks for the post, it is very helpful!
However, as I dont fully understand the code as I am uncertain about what the second line ('total per row' [expected],1) means. I believe that this is a column, but is not 'Value 1' only consiting of one column -->LASTNONBLANK ( 'total per row'[expected], 1 )? What is the purpose of LASTNONBLANK ( 'Select'[Select], 1 ) ?
Kind regards,