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.
Hi all,
I'm breaking my head about the following.
I made little salesexample which shows my problem (see picture below).
As an example I want to know how many distinct customers made orders with Contoso.
The measure I use is
Solved! Go to Solution.
Hi @Anonymous ,
That's by default. As In your formula , we will get the DISTINCTCOUNT of CustomerKey of the filtered table that SalesExample[Brand] is not"Contoso". So the result 5 should be correct.
Distinct Customers without Contoso = CALCULATE(DISTINCTCOUNT(SalesExample[CustomerKey]), SalesExample[Brand] <> "Contoso")
So in your scenario, to get your excepted result we can update the measure as below.
Distinct Customers without Contoso = VAR con = CALCULATETABLE ( VALUES ( SalesExample[CustomerKey] ), FILTER ( SalesExample, SalesExample[Brand] = "Contoso" ) ) RETURN CALCULATE ( DISTINCTCOUNT ( SalesExample[CustomerKey] ), FILTER ( SalesExample, SalesExample[CustomerKey] IN con = FALSE () ) )
Hi @Anonymous ,
That's by default. As In your formula , we will get the DISTINCTCOUNT of CustomerKey of the filtered table that SalesExample[Brand] is not"Contoso". So the result 5 should be correct.
Distinct Customers without Contoso = CALCULATE(DISTINCTCOUNT(SalesExample[CustomerKey]), SalesExample[Brand] <> "Contoso")
So in your scenario, to get your excepted result we can update the measure as below.
Distinct Customers without Contoso = VAR con = CALCULATETABLE ( VALUES ( SalesExample[CustomerKey] ), FILTER ( SalesExample, SalesExample[Brand] = "Contoso" ) ) RETURN CALCULATE ( DISTINCTCOUNT ( SalesExample[CustomerKey] ), FILTER ( SalesExample, SalesExample[CustomerKey] IN con = FALSE () ) )
Thanks for your quick reply.
Your new measure seems like working perfect, but I still can't stand it that my measure is calculating the wrong result ;).......And still it's no logic to me.
But thanks again!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |