Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
HR3038511
Regular Visitor

Concatenate values despite filter

Hi there, 

 

I have two measures (A, B). They both have tags (positive, negative, neutral): 

 

Tag1.png

Now, I want to be able to filter for a specific tag and show next to the measure a concatenation of ALL tags of that measure.  

When I filter on the tag "neutral" currently I'm only getting the tag neutral next to the measure. 

 

Tag2.png

The final "Tag Name" I want to obtain should "positive, negative, neutral" since in the data set the measure A has all tags. 


Any idea how to approach this?

My Power BI Example file is uploaded here: https://easyupload.io/2h5y0d

Thanks!

 

2 ACCEPTED SOLUTIONS
Bipin-Lala
Solution Supplier
Solution Supplier

Hi @HR3038511,

 

You can approach this problem by creating another table containing the measure and the concatenated tags and using relationships to display correct values on filtering.

 

The steps are explained below. To implement the below steps, please refer to the pbix file attached.

 

  • Create a concatenated tags table - Using the original Measure Table (I added the Tag Name field to it), create another duplicate table and group by the table on Measure such that you get concatenated tags along with it.

Measure Table

BipinLala_0-1715804727715.png

 

Concatenated Tags Table

BipinLala_1-1715804757737.png

 

  • Create a relationship between the concatenated tags table and the measure table on the measure field. Set the direction of filtering to both sides.

BipinLala_2-1715804880574.png

 

  • In the table visual, use the fields Measure and TagList from the Concatenated Tags table.
  • For filtering, use the Tag Name from the Measure table

Due to the relationships, the Tag Name from the Measure table should filter the corresponding Measure and subsequent Tag List in the Concatenated Tags table.

 

Examples:

 

BipinLala_3-1715805019102.png

 

BipinLala_4-1715805037724.png

 

Please refer to the pbix file attached - https://easyupload.io/xnlt7w

 

Let me know if you have any questions!

View solution in original post

v-zhengdxu-msft
Community Support
Community Support

Hi @HR3038511 

 

Thanks for the reply from @Bipin-Lala , please allow me to provide another insight:
Add a measure:

MEASURE 2 =
VAR _currentMeasure =
    SELECTEDVALUE ( 'Measure Table'[Measure] )
RETURN
    CONCATENATEX (
        FILTER ( ALL ( 'Measure Table' ), 'Measure Table'[Measure] = _currentMeasure ),
        [Tag Name],
        ","
    )

Then add the measure to the table visual, the result is as follow:

vzhengdxumsft_0-1715828312241.pngvzhengdxumsft_1-1715828321460.pngvzhengdxumsft_2-1715828327370.png

PBI file attached, hope this helps.

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-zhengdxu-msft
Community Support
Community Support

Hi @HR3038511 

 

Thanks for the reply from @Bipin-Lala , please allow me to provide another insight:
Add a measure:

MEASURE 2 =
VAR _currentMeasure =
    SELECTEDVALUE ( 'Measure Table'[Measure] )
RETURN
    CONCATENATEX (
        FILTER ( ALL ( 'Measure Table' ), 'Measure Table'[Measure] = _currentMeasure ),
        [Tag Name],
        ","
    )

Then add the measure to the table visual, the result is as follow:

vzhengdxumsft_0-1715828312241.pngvzhengdxumsft_1-1715828321460.pngvzhengdxumsft_2-1715828327370.png

PBI file attached, hope this helps.

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Bipin-Lala
Solution Supplier
Solution Supplier

Hi @HR3038511,

 

You can approach this problem by creating another table containing the measure and the concatenated tags and using relationships to display correct values on filtering.

 

The steps are explained below. To implement the below steps, please refer to the pbix file attached.

 

  • Create a concatenated tags table - Using the original Measure Table (I added the Tag Name field to it), create another duplicate table and group by the table on Measure such that you get concatenated tags along with it.

Measure Table

BipinLala_0-1715804727715.png

 

Concatenated Tags Table

BipinLala_1-1715804757737.png

 

  • Create a relationship between the concatenated tags table and the measure table on the measure field. Set the direction of filtering to both sides.

BipinLala_2-1715804880574.png

 

  • In the table visual, use the fields Measure and TagList from the Concatenated Tags table.
  • For filtering, use the Tag Name from the Measure table

Due to the relationships, the Tag Name from the Measure table should filter the corresponding Measure and subsequent Tag List in the Concatenated Tags table.

 

Examples:

 

BipinLala_3-1715805019102.png

 

BipinLala_4-1715805037724.png

 

Please refer to the pbix file attached - https://easyupload.io/xnlt7w

 

Let me know if you have any questions!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.