Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a pretty simple sum expression that uses set analysis:
sum({<[CustomerType]={"1","2","3"}>} [Sales])
This expression is working perfectly for me when I do not have any filters selected. HOWEVER, I still want to filter specifically on the individual CustomerTypes of 1, 2, and 3. When I select just one of them (e.g. CustomerType = "1"), the value doesn't change. The value showing is still the sum of all three CustomerTypes instead of just the one I have my filter set on.
How do I solve this problem or is it not possible?
Hi, @nrq
try like this
sum({<[CustomerType]*={"1","2","3"}>} [Sales])
Hi, @nrq
try like this
sum({<[CustomerType]*={"1","2","3"}>} [Sales])
Thanks, that works. One other thing to complicate this further: Can I put multiple sets in the same expression? This is my current code which isn't working properly but showcases what I'm trying to do:
sum({<[CustomerType]*={"1"},[Location]*={"United States","Canada"}>} {<[CustomerType]*={"2","3"},[Location]*={"United States","Mexico","India"}>} [Sales])
In other words, I only want to include data for CustomerType 1 when the location is in the United States or Canada. But for CustomerTypes 2 and 3, I only want to include data when the location is in the United States, Mexico, or India. Is creating two sets like this in the same expression possible?
I don't know what your real requirement is, but imagining a scenario I would create a variable that would work alongside a button and alternate between [CustomerType]*={"1"} and [CustomerType]*={"2","3"} as well as [Location ].
If you are unable to go that way, I ask you to end the topic to close this first case, and open a new topic with this question so that others can help you with your requirement. If I also have any other ideas, I will help in this new thread.
Thanks!