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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Pavithra_Ramesh
Frequent Visitor

A visual that shows multiple sources used in more than one script

Hi,

 

I have Labs and then I have Sources from which these Labs get the data. 

I need a formula and the best suited visual to display all the sources and then highlight those sources that repeat across Labs. Could you please help?

 

Sample Data:

LabSource
AS1
AS2
AS3
AS4_CZ
AS5_CZ
BS6
BS4_CZ
CS5_CZ
CS3

 

Expected Output:

LabSource
AS1
AS2
A, CS3
A,BS4_CZ
A,CS5_CZ
BS6
2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

This measure works

Measure = CONCATENATEX(VALUES(Data[Lab]),Data[Lab],", ")

Hope this helps.

Ashish_Mathur_0-1729392674789.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

You may also use this Power Query code

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUQo2VIrVgTKNEExjBNMk3jkKwTOF8ZxAPDMEE67MGUWZM9S0WAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Lab = _t, Source = _t]),
    #"Grouped Rows" = Table.Group(Source, {"Source"}, {{"Count", each Text.Combine([Lab],", ")}})
in
    #"Grouped Rows"

Hope this helps.

Ashish_Mathur_1-1729392870078.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
PavanLalwani
Resolver II
Resolver II

To display sources that are used across multiple labs and highlight those that repeat, follow these steps:

### 1. **Formula for Repeated Sources**:
Create a **calculated column** or measure using DAX to concatenate lab names for each source:
```DAX
LabConcat =
CONCATENATEX(
VALUES('Table'[Lab]),
'Table'[Lab],
", "
)
```
This will list all labs using each source.

### 2. **Best Visual**:
- **Matrix Visual**: This is ideal to list **Sources** as rows and **Labs** as columns. Use conditional formatting to highlight repeated sources (those with concatenated lab names).
- **Table Visual**: You can also use a simple **Table** visual with conditional formatting.

Let me know if you need more guidance!

Ashish_Mathur
Super User
Super User

Hi,

You may also use this Power Query code

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUQo2VIrVgTKNEExjBNMk3jkKwTOF8ZxAPDMEE67MGUWZM9S0WAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Lab = _t, Source = _t]),
    #"Grouped Rows" = Table.Group(Source, {"Source"}, {{"Count", each Text.Combine([Lab],", ")}})
in
    #"Grouped Rows"

Hope this helps.

Ashish_Mathur_1-1729392870078.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

This measure works

Measure = CONCATENATEX(VALUES(Data[Lab]),Data[Lab],", ")

Hope this helps.

Ashish_Mathur_0-1729392674789.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Kedar_Pande
Super User
Super User

Create a Calculated Column:

Lab_Sources_Concat = 
CONCATENATEX(
FILTER(
'Table',
'Table'[Source] = EARLIER('Table'[Source])
),
'Table'[Lab],
", "
)

Table: Display the Lab and Source columns, along with the new concatenated column
Highlight rows where the concatenated labs include more than one lab. For example, you can apply a color rule where if the Lab_Sources_Concat column contains a comma (,), that row is highlighted.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Thank you! This gave me direction. I got some errors (circular dependency, expression referes to multiple columns..) and hence I followed the below which worked:

1. Created a Calculated Table

DistinctSourceLab =

SUMMARIZE(

'Table',

'Table'[Source],

'Table'[Lab]

)

 

2. Created a Measure

Lab_Sources_Concat =

VAR CurrentSource = SELECTEDVALUE('Table'[Source])

RETURN

CONCATENATEX(

FILTER(

DistinctSourceLab,

DistinctSourceLab[Source] = CurrentSource

),

DistinctSourceLab[Lab],

", "

)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.