Forum Discussion
Need help using a measure as a virtual table filter
Hello,
I have a measure that categorizes products based on availability (days sold at a store). That measure has 4 possible labels: core item (sold at least 60% of the days in pre and post periods), deleted item (sold at least 60% in pre and less than 10% in post period), new item (sold in less than 10% of pre period and at least 60% of post period) and other item (fits none of the above).
I am trying to calculate the net sales and average price for core items in the pre period first (later will be calculating price change post-pre holding quantity constant).
I tried creating a virutal table that holds all items and their tag and then running a SumX of sales but it's not working. Here is the core sales measure syntax I'm using:
The problem I'm running into is that my core item measure sums up the sales of all items, not just core items.
Any ideas on how to calculate the metric by the measure tag would be really helpful. Thank you!
marto0116 check this post Dynamic segmentation – DAX Patterns
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
4 Replies
- parry2kSuper User
marto0116 check this post Dynamic segmentation – DAX Patterns
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
- Ashish_MathurSuper User
Hi,
Why are you creating a virtual table? Why not write a measure?
- marto0116Regular Visitor
Hi Ashish,
It was my first approach. What would a measure that calculates sales by tag type look like?
Thanks!
Martin
- Ashish_MathurSuper User
Hi,
Share data in a format that can be pasted in an MS Excel file and show the expected result.