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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Pavithra_sarava
New Member

Need to find order without product without using calculated columns/tables

Hello All,

I've 2 table in my report.

 

Order table: Order ID,Order name, value, Products,etc

Order detail table: Order ID,Product name, Specification, etc

 

There's a relationship between Order & Order detail table (One to many)

I need to find number of order without products. Here I can't use calculated column or table as my source is direct query and I won't be able to do auto refresh.

Can someone suggest me how to get the desired result? 

1 ACCEPTED SOLUTION

How is an order created if there are no products? 

 

Try 

OrdersWithoutProducts =
   CALCULATE(
      COUNT(Orders[Order ID]),
      NOT(Orders[Order ID] IN VALUES('Order detail'[Order ID]))
   )

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

If you have a one-to-many relationship from orders to order details then you could use

# orders no products =
SUMX ( 'orders', IF ( ISEMPTY ( RELATEDTABLE ( 'order details' ) ), 1 ) )

Hi,

sorry it's not working

How is an order created if there are no products? 

 

Try 

OrdersWithoutProducts =
   CALCULATE(
      COUNT(Orders[Order ID]),
      NOT(Orders[Order ID] IN VALUES('Order detail'[Order ID]))
   )

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.