Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi all,
I'm working on a measure using Contoso Model and I would like to understand why I'm getting a different result using the following measures.
CONTEXT:
I have a slicer on the Product Brand and a visual showing the Customer's Country and the number of distinct orders:
If I choose "A. Datum", I get this:
CASE A:
I built a measure, "Other Brands" to get the number of orders of the other brands for the selected in the slicer:
I built the measure in the following way:
CASE B:
I'm trying to get the same, but building a difference measure to get the "other brands orders".
In place of using different measures, I'm trying to use calcute with a filter.
But the numbers I'm getting are the followings:
I can't figure out why I'm getting these numbers. For example, for A. Datum, 241 is in place of 231.
I can't realize where my misunderstanding is.
Can you help me?
Thanks in advance!
Solved! Go to Solution.
I found the mistake.
CASE A is working wrong. Calculating "Other Brands" as Total - ThisBrand supposes that the intersection between both sets is null, and that is wrong. An order could have many brands inside, so in this case the order should be counted in both sets.
can you please try:
Selected Others Brand =
VAR XBrand = SELECTEDVALUE('Product'[Brand])
Return
CALCULATE([# Orders],FILTER('Product','Product'[Brand] <>xBrand))
if this doesnt work can you please provide with calculation of # order?
Thanks for your answer. I've tried it but it doesn't work.
This is # Orders:
ok i sampled your data is this what you desire?
# Total Orders = CALCULATE(DISTINCTCOUNT(Store[Order number]),Store[Name] = "Online Store",REMOVEFILTERS(Store[Brand]))
# Orders = CALCULATE(DISTINCTCOUNT(Store[Order number]),Store[Name] = "Online Store")
I even created both your cases and they work perfectly fine are you sure there are no missing context?
Eliasavy,
The CASE A is working fine. But I would like to understand why CASE B does not work. It is supposed that the filter in this case B should get the same number but it doesn't.
I share the file I'm using with two pages, the first which works fine and the second which doesn't.
Thanks again for your help!
(I brand new in the foro and I don't know how to upload a file here. I'm sharing in Google Drive)
I found the mistake.
CASE A is working wrong. Calculating "Other Brands" as Total - ThisBrand supposes that the intersection between both sets is null, and that is wrong. An order could have many brands inside, so in this case the order should be counted in both sets.
User | Count |
---|---|
41 | |
27 | |
23 | |
19 | |
16 |
User | Count |
---|---|
54 | |
35 | |
19 | |
19 | |
15 |