Forum Discussion
andicornejo12
Helper II
1 year agoThe expression refers to multiple columns. Multiple columns cannot be converted to a scalar value
Kindly assist on the below; I am trying to filter one table using the column from another table (date type), however, I get the error "The expression refers to multiple columns. Multiple columns ca...
andicornejo12
Helper II
1 year agohello mark_endicott
Thank you so much for your answer. Unfortunately I keep getting the same error message:
mark_endicott
Super User
1 year agoandicornejo12 - Are you attempting to use this DAX in a measure?
If so, that's likely to the problem. At the table level, the result for the flag could be both TRUE and FALSE based on the row, and a measure requires a scalar value.
If you are using a measure, try this:
VAR _table =
ADDCOLUMNS (
gold_procon_projekte_historical,
"@flag",
IF (
gold_procon_projekte_historical[valid_from]
<= SELECTEDVALUE ( gold_procon_stammdaten[stamm_daten] )
&& (
gold_procon_projekte_historical[valid_to]
>= SELECTEDVALUE ( gold_procon_stammdaten[stamm_daten] )
|| ISBLANK ( gold_procon_projekte_historical[valid_to] )
&& gold_procon_projekte_historical[is_current] = TRUE ()
),
1,
0
)
)
RETURN
MAXX ( _table, [@flag] )
It will change your flag to a integer of 1 or 0, but it can now be applied at the row level. I have tested it and it appears to be working fine for me: