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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
fc_wg
New Member

Calculate() return unusual result when trying to return TRUE()

Hi All,

 

I have been scratching my head trying to figure out what happen to my DAX. I simply just want to return a true or false from my calculated measure but it's given me a lot grieve.

 

Here is the calculated measure I am trying to write:

 

VAR booked_units =  CALCULATE(
                        SUM('Freight - Supplier Inbound'[Booked_Units]), 
                        FILTER('Freight - Supplier Inbound', NOT ISEMPTY('Freight - Supplier Inbound'))
                    )
VAR ordered_units = CALCULATE(
                        SUM('Purchase Order'[Ordered_Units]), 
                        FILTER('Freight - Supplier Inbound', NOT ISEMPTY('Freight - Supplier Inbound'))
                    )
RETURN IF(booked_units >= ordered_units, TRUE(), FALSE())

 


Before I use the above measure this is the result I am seeing which is correct:

fc_wg_0-1700481803864.png

But as soon as I tried to add the above measure this is what I get. It not only returned the wrong result and also made the "Ordered Units" blank (If I have 10+ fields in the table it'll run into memory issue error): 

fc_wg_1-1700481846009.png

 

This is my dataset model (I have to make the freight table one-to-many bi-directional as 1 purchase order can have more than one freight transactions):

fc_wg_2-1700482143582.png

 

Where am I doing something wrong here? Any help is much appreciated.

 

Thanks.

1 REPLY 1
lbendlin
Super User
Super User

why bidirectional though? Try to use TREATAS instead.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.