Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hello everyone!
I am having the following situation:
I have a FACT table called "SalesLines" which is connected to DIM "Invoiceheader"
SalesLines has multiple lines per Sales Order
InvoiceHeader as a DIM has just one Sales Order per line.
I need a dax measure to know the count of Sales Orders.
If i do it over the FACT, I get a huge number because when a Sales Order has 4 lines is counting as 4. If I do it over the DIM table, the visual has low performance and takes 2 min to display.
The closest that i have been is here:
Solved! Go to Solution.
Hi @GermanTersoglio
If the column exists in the fact table the
= DISTINCTCOUNT ( 'SalesLines'[SalesId] )
If not then
=
COUNTROWS (
DISTINCT (
SELECTCOLUMNS (
SalesLines,
"@SalesID", RELATED ( 'Invoice Header'[SalesId] )
)
)
)
Hi @GermanTersoglio
If the column exists in the fact table the
= DISTINCTCOUNT ( 'SalesLines'[SalesId] )
If not then
=
COUNTROWS (
DISTINCT (
SELECTCOLUMNS (
SalesLines,
"@SalesID", RELATED ( 'Invoice Header'[SalesId] )
)
)
)
Hi Tamerj,
I was facing my measure in the wrong way.
You solution works perfectly. I really appreciate your help.
Thanks for sharing your knowledge 🙂
User | Count |
---|---|
13 | |
10 | |
8 | |
7 | |
5 |
User | Count |
---|---|
24 | |
16 | |
15 | |
10 | |
7 |