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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Frenchtom811
Resolver I
Resolver I

Calculate function with a related table, multiple conditions and logic.

So I admit right away that I could be asking too much from a Calculate function. 😁

 

In my mind this is what I am picturing: 

 

GoQuote = CALCULATE(DISTINCTCOUNT(T1[Quote Number]),

(T1[Process] <> "Standard" &&

'T2'[GoDate] >= DATE(2020,11,16))) 

 

The error I receive is:

 

The expression contains multiple columns but only a a single coumn can be used in a true/false expression that is used a a table filter expression.

 

Any idea how I can count the number of quotes in Table 1 that are not "Standard" and occur after a certain date located in Table 2?  Something tells me that I am overthinking this one.

 

Thanks!

Tom

 

 

5 REPLIES 5
amitchandak
Super User
Super User

@Frenchtom811 , check datatype T1[Process] should be text and 'T2'[GoDate]  should be Date. else adjust the formula or data type

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Frenchtom811
Resolver I
Resolver I

Hi @amitchandak , I think we are almost there.  Now I have this error:

Frenchtom811_0-1608323204617.png

 

amitchandak
Super User
Super User

@Frenchtom811 , is one of the filters is on a measure?

Try like

GoQuote = CALCULATE(DISTINCTCOUNT(T1[Quote Number]),Filter(T1,T1[Process] <> "Standard") ,Filter('T2', 'T2'[GoDate] >= DATE(2020,11,16)))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Frenchtom811
Resolver I
Resolver I

Hello @amitchandak !  Thanks for the effort but I get the same error regarding the use of a True/False expression within a CALCULATE function.

amitchandak
Super User
Super User

@Frenchtom811 , Try like

GoQuote = CALCULATE(DISTINCTCOUNT(T1[Quote Number]),
T1[Process] <> "Standard" , 'T2'[GoDate] >= DATE(2020,11,16))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.