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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
andicornejo12
Helper II
Helper II

The 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 cannot be converted to a scalar value"  when i input the below formula to create a column. How do i solve it?
 

FilteredProjects =

FILTER (

    gold_procon_projekte_historical,

    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()

    )

)

3 ACCEPTED SOLUTIONS
mark_endicott
Super User
Super User

@andicornejo12 - Try this:

 


FILTER (

    ALL(gold_procon_projekte_historical[valid_from], gold_procon_projekte_historical[valid_to], gold_procon_projekte_historical[is_current]),

    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()

    )

)

 

 

Essentially I'm applying the filters to the specific columns inside the ALL(), rather than the whole table. 

 

If this works for you, please accept it as the solution, it will helpwith visibility for others with the same problem. 

View solution in original post

hello @mark_endicott 

 

Thank you so much for your answer. Unfortunately I keep getting the same error message:

andicornejo12_0-1730296508174.png

 

View solution in original post

@andicornejo12 - 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:

 

mark_endicott_0-1730298583103.png

 

View solution in original post

4 REPLIES 4
mark_endicott
Super User
Super User

@andicornejo12 - Try this:

 


FILTER (

    ALL(gold_procon_projekte_historical[valid_from], gold_procon_projekte_historical[valid_to], gold_procon_projekte_historical[is_current]),

    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()

    )

)

 

 

Essentially I'm applying the filters to the specific columns inside the ALL(), rather than the whole table. 

 

If this works for you, please accept it as the solution, it will helpwith visibility for others with the same problem. 

hello @mark_endicott 

 

Thank you so much for your answer. Unfortunately I keep getting the same error message:

andicornejo12_0-1730296508174.png

 

Thanks so much!

Yes it did work for me too 😊

@andicornejo12 - 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:

 

mark_endicott_0-1730298583103.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.