Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Get 2 rows(Duplicate) for each row based on slicer selection

Hi,

I have a requirement to show the same row based on slicer selection.


when index is selected as TTF then automatically i need to see 2 rows of same columns as per below screenshot.

 


when index is selected as Matif then automatically i need to see 2 rows of same columns as per below screenshot.


may i know how to acheive this ? Please any suggestion will help


Thanks

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

    Please try below steps:

    1. below is my test table

    Table:

    Table2:

    2. create a measure with below dax formula

    Measure =
    VAR idx =
        SELECTEDVALUE ( 'Table 2'[Index] )
    VAR tmp =
        SUMMARIZE (
            ALL ( 'Table' ),
            [Index],
            [Last Value],
            [Assumption Scenario],
            [Correlation],
            "CTN", COUNTROWS ( 'Table' ),
            "ID", CONCATENATEX ( 'Table', [ID] )
        )
    VAR tmp1 =
        FILTER ( tmp, [CTN] >= 2 && [Index] = idx )
    VAR str =
        CONCATENATEX ( tmp1, [ID] )
    VAR val =
        IF ( CONTAINSSTRING ( str, SELECTEDVALUE ( 'Table'[ID] ) ), 1, 0 )
    RETURN
        IF ( HASONEFILTER ( 'Table 2'[Index] ), val, 1 )
    

    3. add  a table visual with Table fields, add a slicer with Table 2 field, add measure to table visual filter pane and set

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,


    Any suggestions please ?

    Thanks

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Please try below steps:

    1. below is my test table

    Table:

    Table2:

    2. create a measure with below dax formula

    Measure =
    VAR idx =
        SELECTEDVALUE ( 'Table 2'[Index] )
    VAR tmp =
        SUMMARIZE (
            ALL ( 'Table' ),
            [Index],
            [Last Value],
            [Assumption Scenario],
            [Correlation],
            "CTN", COUNTROWS ( 'Table' ),
            "ID", CONCATENATEX ( 'Table', [ID] )
        )
    VAR tmp1 =
        FILTER ( tmp, [CTN] >= 2 && [Index] = idx )
    VAR str =
        CONCATENATEX ( tmp1, [ID] )
    VAR val =
        IF ( CONTAINSSTRING ( str, SELECTEDVALUE ( 'Table'[ID] ) ), 1, 0 )
    RETURN
        IF ( HASONEFILTER ( 'Table 2'[Index] ), val, 1 )
    

    3. add  a table visual with Table fields, add a slicer with Table 2 field, add measure to table visual filter pane and set

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.