Forum Discussion
DAX query to create new boolean columns
- Anonymous6 years ago
HiAnonymous
You are looking for a sort of unpivot function to create colunms using DAX. You can do this in m-query, but as far as I know you can't dynamically create columns in dax without some sort of manual intervention.
Using a measure it is no problem to create your table.hope this still a bit helpfull.
Jan
HiAnonymous
You are looking for a sort of unpivot function to create colunms using DAX. You can do this in m-query, but as far as I know you can't dynamically create columns in dax without some sort of manual intervention.
Using a measure it is no problem to create your table.
hope this still a bit helpfull.
Jan
- Anonymous6 years agoNot applicable
Hi Anonymous ,
thanks for your help and sorry for the late response.
When I try your DAX formula, I get the error "Expressions that yield variant data-type cannot be used to define calculated columns." if I create a new column with your expression. If, as you suggest, I create a measure, then I am able to use it in a visual, but only the "Total" column is created, not the boolean columns Tag_T1, Tag_T2 etc.
I have a further question: is creating a measure, rather than defining a new table in the data model, the most efficient way to do it? Wouldn't a new table allow me to more flexibility when creating new visuals based on this data? I am asking since I am completely new to power bi. Thank you.