The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
25 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |