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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
joannageorge
Frequent Visitor

Trying to calculate sales volume using CALCULATE, but it gives me error

Hi guys, I am trying to calculate the sales volume of a few customers below, and filtered by Sales Method.
This is my dax code but it gives me an error : "The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column."
 
What is going on? how can i fix this? 
 
Eligible Vol v2 =

 

VAR CA_vol =
CALCULATE (SUM ( [Shipped Quantity in MFBM] ), Customer[Sold To Customer Group Name] = "GROUPE BMR GROUP",
Sales[Sales Method] = "CA")
 
VAR all_vol =
CALCULATE (SUM ( [Shipped Quantity in MFBM] ), Customer[Sold To Customer Group Name] = "HOME DEPOT GROUP" || "LOWE'S GROUP" || "ADVANCE GROUP")
 
VAR CT_vol =
CALCULATE (SUM ( [Shipped Quantity in MFBM] ),Customer[Sold To Customer Group Name] = "MENARDS GROUP"|| "84 LUMBER GROUP" || "BUILDERS FIRSTSOURCE GROUP" || "JOES LUMBER" || "DO IT BEST GROUP" || "LBM ADVANTAGE GROUP" || "LMC GROUP" || "US LBM GROUP" || "DOMAN BUILDING MATERIALS GROUP LTD." || "LOUISIANA-PACIFIC GROUP" || "STANDARD BUILDING SUPPLIES GROUP" || "UFP PURCHASING, INC. GROUP" || "WELCO GROUP" || "WOODTONE GROUP" || "CANADIAN ENGINEERING GROUP" || "MILLMAN GROUP", Sales[Sales Method] = "CT")
 
RETURN
   CALCULATE (SUM ( [Shipped Quantity in MFBM] ), CA_vol, all_vol, CT_vol)
4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Share some data, describe the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish, I've sent you a DM because some data may be sensitive. Could you kindly please check your inbox?

OwenAuger
Super User
Super User

Hi @joannageorge 

Just a small tweak needed.

Column = A || B || C isn't correct syntax for what you are wanting to do.

Instead, one way to write your Sold To Customer Group Name conditions is this (using the CA_vol example):

 

Customer[Sold To Customer Group Name] IN { "HOME DEPOT GROUP", "LOWE'S GROUP", "ADVANCE GROUP" }

 

 

You can also write it this way, but I would recommend the first option.

 

Customer[Sold To Customer Group Name] = "HOME DEPOT GROUP" || Customer[Sold To Customer Group Name] = "LOWE'S GROUP" || Customer[Sold To Customer Group Name] = "ADVANCE GROUP"

 

 

Also, for your final RETURN statement, I think you want this, which is the sum of the three variables defined earlier:

 

RETURN
    CA_vol + all_vol + CT_vol

 

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Hi Owen, 

Thank you for your reply. I tried both methods, but it doesnt seem to work and is still returning the same error.

 

For the RETURN part, if I sum them all up, like you did above, it shows one value for all customers (example: 1,7000,200) 

 

Any other ideas? 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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