The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello together,
i need help on a measure to calculate a quote. I have a table like this:
To get the quote i need the distinctcount article where the invoicetype is "nachorder". This is no problem
Hi @morizf
I suggest to create a calculated column to exclude values first:
IsValid Column =
IF (
CALCULATE (
COUNTROWS(MyTable),
ALLEXCEPT ( MyTable, MyTable[Article])
)
<> CALCULATE(COUNTROWS(MyTable), ALLEXCEPT(MyTable, MyTable[Article], MyTable[invoicetype])),
FALSE(),
IF (
CALCULATE (
VALUES ( MyTable[invoicetype] ),
ALLEXCEPT ( MyTable, MyTable[Article], MyTable[invoicetype] )
)
<> "nachorder",
FALSE(),
TRUE ()
)
)
And later on, count over this column:
Measure = CALCULATE(DISTINCTCOUNT(MyTable[Article]),MyTable[IsValid Column]=TRUE())
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
11 | |
7 |