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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

ALLSELECTED alternative, check one value against multiple

Hey,

 

I have a query regarding a DAX statement to determine if one value is greater than the other in a matrix. One column contains one value (4.00) and the other contains a number of values (1, 3, 2000)

 

I am trying to determine the best way of seeing if the value in column A is greater than those in column B, if it is, give it a 1, else 0. I have achieved this, but the problem is, before filtering on LOD and GAC, it doesn't seem to work:

 

lxtrxi_0-1604068768721.png

 

When I add a filter on to show only 1 and 3:

lxtrxi_1-1604068816377.png

 

It works! But why? The query I am using is below:

 

ExceedCheck = 

VAR GAC =
    MAXX (
        ALLSELECTED ( 'Overall Query'[GAC]),
        CALCULATE (
            MAX ( 'Overall Query'[GAC] )
        )
    )
VAR LOD =
    MAXX (
        ALLSELECTED ( 'Overall Query'[LOD]),
        CALCULATE (
            MAX ( 'Overall Query'[LOD] )
        )
    )
RETURN
    SWITCH (
        TRUE (),
        
        NOT ISBLANK ( LOD ) && NOT ISBLANK ( GAC ) && LOD >= GAC, 1,
        
        0
    )
1 REPLY 1
AlB
Community Champion
Community Champion

Hi @Anonymous 

Can you share the actual pbix, or one with dummy data the reproduces the problem?

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors