martingaleh
Board Regular
- Joined
- Jul 18, 2011
- Messages
- 83
I can't figure out what the vectorization is in DAX
If I have a calculated column based on a slicer like
=Slicer[field]
Of course that doesnt' work. I don't know why, but you need to wrap it in:
=Values(Slicer[field]), probably because Dax tries to combine its column logic and its aggregation logic into one concept whereas every other BI tool I've seen separates them.
If I want the column to return Slicer[field1]&"_"&Slicer[field2], the following doesn't work
= Slicer[field1]&"_"&Slicer[field2]
=values(Slicer[field1]&"_"&Slicer[field2])
=values(Slicer[field1])&"_"&values(Slicer[field2])
and finally if I want to do an if statement with the slicer data
if(hasonevalue(slicer[field1]),if(values(Slicer[field1])&"_"&values(Slicer[field2])>[field1]&"_"&[field2]
What's the right code for that?
Thanks for reading.
p.s. It's fake vectorization because in numpy or pandas or whatever, the vectorization would be explicit and it would be crystal clear what the transform was.
If I have a calculated column based on a slicer like
=Slicer[field]
Of course that doesnt' work. I don't know why, but you need to wrap it in:
=Values(Slicer[field]), probably because Dax tries to combine its column logic and its aggregation logic into one concept whereas every other BI tool I've seen separates them.
If I want the column to return Slicer[field1]&"_"&Slicer[field2], the following doesn't work
= Slicer[field1]&"_"&Slicer[field2]
=values(Slicer[field1]&"_"&Slicer[field2])
=values(Slicer[field1])&"_"&values(Slicer[field2])
and finally if I want to do an if statement with the slicer data
if(hasonevalue(slicer[field1]),if(values(Slicer[field1])&"_"&values(Slicer[field2])>[field1]&"_"&[field2]
What's the right code for that?
Thanks for reading.
p.s. It's fake vectorization because in numpy or pandas or whatever, the vectorization would be explicit and it would be crystal clear what the transform was.