Forum Discussion

msprog's avatar
msprog
Advocate III
6 years ago
Solved

RELATEDTABLE and distinct

HI, I need some help here. I have a simple powerbi model with 2 tables, Product and Sales.   The Sales table has fields: OrderNo, LineNo, ProductKey , Qty, etc The Product table has ProductKey, ...
  • vik0810's avatar
    6 years ago

    Hi msprog,

     

    you can use following DAX:

     

    NumberOfOrders = CALCULATE(DISTINCTCOUNT(sales[OrderNo]), RELATEDTABLE(sales))