Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Shopper | Item |
shopper 1 | item 1 |
shopper 1 | item 2 |
shopper 1 | item 3 |
shopper 2 | item 3 |
shopper 2 | item 4 |
shopper 2 | item 10 |
shopper 2 | item 11 |
shopper 3 | item 1 |
shopper 3 | item 10 |
shopper 3 | item 14 |
Solved! Go to Solution.
an update - inspired by your posts, I was able to find a simple solution. Briefly:
This seems to work, thanks big time @V-lianl-msft @littlemojopuppy !
What exactly do you need to calculate? Counts of shoppers? % of total customers?
Thanks for reaching out! I need to calculate: Share of (certain) items, quantity of items bought, whether item X was bought by buyers of Y etc. There are numerious calculations I need, all requiring to be able to filter "shoppers of item X"
I'm assuming that Items will be in a slicer and you could use the SELECTEDVALUE function to reference a selected Item. Overly simplistic example...and will always return a value of 1
CALCULATE(
DISTINCTCOUNT(Item[ID]),
Item[ID] = SELECTEDVALUE(Item[ID])
)
Let's try out one of your measures...
thanks for the quick feedback. I might be missing something, but I get an error that says "A function 'SELECTEDVALUE' has been used in a True/False expression that is used as a table filter expression. This is not allowed."
Let's have some code to look at
Literally copied your code. Table name is "basket", column with products (items) is "product". I'm a novice user so thanks for the patience!
Sorry for the delay in replying...I stepped out for a moment. Take this.
Now can I ask specifically what you want to accomplish and how you might want to present it? Because filter context may automatically take care of filtering for only selected products (for example, in a matrix, chart, graph or table) and we may simply be over-complicating this.
Thanks @littlemojopuppy , this formula works but I'm not there yet.
For start, I would like to get the following:
this is one of the metrics. next to items I also have additional item-related variables, like time spent looking at the item. I need to be able to analyze all of these variables. Like buyers of item 1 have spent X amount of time looking at item 2, Y amount of time looking at item 3 etc. This seems a bit different from the usual basket analysis.
Hope this makes sense, thanks!
an update - inspired by your posts, I was able to find a simple solution. Briefly:
This seems to work, thanks big time @V-lianl-msft @littlemojopuppy !
User | Count |
---|---|
139 | |
113 | |
103 | |
73 | |
63 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |