Forum Discussion
function Values doesn t return Table of values but error
Hi,
I want to use VALUES function and study from https://dax.guide/values/ that input is table/column and output table (one or more columns)
I tried to od it on most simplest case but it failed, can sombebody told me why ? everything seems OK based on DAX guide, what I missed ?
Current Data Model
My DAX formula
Measure = VALUES(Locations[Location])
When I tried to test it on table
Measure = VALUES(Locations)
I got another error "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."
I am totally confused, because there is only one condition that input parameter must be table or column,
any ideas what I missed ? (Don t think so that DAX.guide is wrong in description)
thanks in advance!
14 Replies
- JamesFR06Resolver IV
Hi
With a measure you can return only a unique value
Values will not work because it return a list of unique values of the column.
- AnonymousNot applicable
Hello JamesFR06 ,
thanks for input !
but in documentation is written that it returns table/tabular and not scalar, therefore I am confusedI also tried to use it in CALCULATE(VALUES(Locations)) and also it is not working, so I am confused again 😄
issue is definitively somewhere in my code
- AnonymousNot applicable
JamesFR06I also tried CALCULATETABLE(VALUES(Locations)) and doesn t any output
- JamesFR06Resolver IV
What calculation do you want to do ?
- AnonymousNot applicable
Hi JamesFR06 ,
my whole scenario is setup 2 slicers which each one will affect second one, so if I select one speicific user in slicer, then second slicer (with location values) will be filtered based on previous option.So my logic is following
Measure = CALCULATETABLE(VALUES(Locations), FILTER(Users,Users[Name] ))issues is that I cannot create table that will be filtered by second parameter
then I tried to bugfix it one-by-one and see first issue in VALUES(LOCATIONS) then I am not able to display as a single measure, thefore I check documentation and see that result is tabular but error claims that it must be scalar, I dont think so that it is error in PBI and was not founded till nowaffectedSlicer = Calculatetable (Cal)
- JamesFR06Resolver IV
It's automatic, you just have to put the column name in 1 slicer and if relationshios are ok it should be ok