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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
MP_123
Microsoft Employee
Microsoft Employee

all selected function

hi,

i have 'products' column and also a slicer.

my connection is via direct query.

i want to create new measure\column that holds the whole products (even if one's is selected)

the measure:

CALCULATE(VALUES(uus[CardFriendlyName]),ALLSelected(uus[CardFriendlyName]))

gives me the selected product although the all selected function...

and 

CALCULATE(VALUES(uus[CardFriendlyName]),ALL(uus[CardFriendlyName]))

gives me error of 

Error Message:

MdxScript(Model) (1, 43) Calculation error in measure 'uus'[Measure 7]: A table of multiple values was supplied where a single value was expected.

 

is someone have an idea?

thanks a lot!!

 

3 REPLIES 3
Eric_Zhang
Microsoft Employee
Microsoft Employee

@MP_123

 

A measure requires a scalar value while VALUES() may return more than one value. According to your description, it seems you're looking for a measure as

 

 

yourMeasure= CONCATENATEX(ALL(uus),uus[CardFriendlyName],",")

 

In DirectQuery Mode, to enable the CONCATENATEX function, select File > Options and then Settings > Options > DirectQuery, then selecting the option *Allow unrestricted measures in DirectQuery mode*.

@Eric_Zhang hi, thanks a lot!

 

actually the syntax is ok but i want to create a column, that i will put into table for example

and not one string

 

thanks!


@MP_123 wrote:

@Eric_Zhang hi, thanks a lot!

 

actually the syntax is ok but i want to create a column, that i will put into table for example

and not one string

 

thanks!


 

A column put to what table? Based on my test, in DirectQuery mode, calculated table is not allowed. Can you be more specific on your scenario?

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.