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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

analysis by grouping

Hi everyone,

 

I'm wondering if there is a way to use DAX to get an analysis based on a grouped variable. For example, I have two columns: Case # & drug. Each drug in a specific case is a new row but each case has multiple rows because there are multiple drugs in each case. Is there a way to output a single row per case and to show all the drugs for that case in the next column? 

 

Thanks in advance!

1 ACCEPTED SOLUTION

Hi,

This measure works

Measure = CONCATENATEX(VALUES(Data[Drug]),data[drug]," ")

Hope this helps.

Untitled.png


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

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Share some data and show the expected result.


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

What my data currently looks like:
Screen Shot 2022-09-16 at 9.58.39 AM.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

How I need the data to look:

Screen Shot 2022-09-16 at 9.58.44 AM.png

 

 

 

 

 

 

 

Thanks!

Hi,

This measure works

Measure = CONCATENATEX(VALUES(Data[Drug]),data[drug]," ")

Hope this helps.

Untitled.png


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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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