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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

DAX problem, filter/relation ignored when I use IF in the RETURN clause

I have two test tables:

Table: "Test Object"

__Marc___0-1633074419671.png

 

Table: "Test Group"

__Marc___1-1633074493355.png

 

These have a unidirectional relation on "Group code"

__Marc___2-1633074552069.png

 

I have created a measure "Test measure":

__Marc___3-1633074685785.png

 

This gives the correct result:

__Marc___4-1633074747709.png

NB: I have a page filter to only show Group Code "G01".

 

But it goes wrong when I use an IF function:

__Marc___5-1633074816134.png

 

I then get the following result. Apparently the relation seems to be ignored now:

__Marc___6-1633074897218.png

NB: The result doesn't change when I use the "Group code" from any of the two tables.

 

It's probably a basic / dumb mistake, but right now I don't see it. What am I missing here?

 

NB: I've created a PBIX file that shows the problem:

https://www.dropbox.com/s/76ld1kv503ul6nm/DAX%20problem%20with%20IF.pbix?dl=0

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Try to create measure like so:

Price category = 
VAR lowestPrice =
    MIN ( Object[Price] )
RETURN
    IF ( lowestPrice <> BLANK (), 
       IF ( lowestPrice < 40, "Low end", "High end" ) 
       )

Icey_0-1633424957762.png

Icey_1-1633424971111.png

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , check that the group code in the visual is taken from Test Object table

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I've tried that. The result doesn't change if the Group code is coming from any of the two tables.

if group code coming from two table. Create the formula on master/dimension table(1 side) and use that in visual

 

Can you share a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Try to create measure like so:

Price category = 
VAR lowestPrice =
    MIN ( Object[Price] )
RETURN
    IF ( lowestPrice <> BLANK (), 
       IF ( lowestPrice < 40, "Low end", "High end" ) 
       )

Icey_0-1633424957762.png

Icey_1-1633424971111.png

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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