cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rkumar Regular Visitor
Regular Visitor

Creating a measure to select all values of a column

Hi All,

We have a requirement where we need to have the distinct values of a column in a measure , Can that be done in dax query  or some other way.

7 REPLIES 7
Highlighted
Stachu Super Contributor
Super Contributor

Re: Creating a measure to select all values of a column

you can use CONCATENATEX in DAX

Measure = CONCATENATEX(DISTINCT('Table'[Column]),'Table'[Column],",") 
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

rkumar Regular Visitor
Regular Visitor

Re: Creating a measure to select all values of a column

We just need distinct values of one column in measure, but measure dosent accepts column without any aggregate function or expression.
Thats the block.

 

Stachu Super Contributor
Super Contributor

Re: Creating a measure to select all values of a column

CONCATENATEX is aggregating the values from the column into string - have you tried the code I've sent?

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

rkumar Regular Visitor
Regular Visitor

Re: Creating a measure to select all values of a column

Yes, i tried.  But due to some reason in september update of PowerBI i am not able to see CONCATENATEX function while creating a measure . Tried same with earlier version of power BI and its working there.

CONCATENATEX.pngWhile creating measure not able to see CONCATENATEX function.

 

Thank You

Stachu Super Contributor
Super Contributor

Re: Creating a measure to select all values of a column

from what I see in your screenshot tha Data View is missing as well, so maybe there is something wrong with your instalation - I use the latest version of PowerBI and CONCATENATEX is there

for the View issue you can try going pressing Home>Edit Queries
https://community.powerbi.com/t5/Desktop/No-Data-View-Option/td-p/18003

it solved the issue for some, maybe it will fix it for you as well

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

rkumar Regular Visitor
Regular Visitor

Re: Creating a measure to select all values of a column

Is dataview availabkle in direct query mode.

Community Support Team
Community Support Team

Re: Creating a measure to select all values of a column

@rkumar,

 

Make sure it is a measure, not calculated column.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Users Online
Currently online: 172 members 2,585 guests
Please welcome our newest community members: