Passing dynamic value to measure

Hello,

I have the challenge pass a value obtained from the slicer to a measure.

Here is what I’m trying to achieve:

  1. From the slicer filter, customer ABC is selected
  2. The customer group for ABC is identified as “Class A”
  3. A measure is created to calculate Total Sales for all “Class A” group within Customer table

Total Sales =
CALCULATE(
[Total Sales],
all( Dim_Customer[Cust_NAME] ),
Dim_CustomerGroup[Cusomter_Group] = “Class A”,
FILTER( Dim_City, Dim_City[City_name] = “Toronto”)
)
4. To dynamically pass a customer group, I tried this

SelectedGroup =
SELECTEDVALUE(Dim_CustomerGroup[Cusomter_Group])

Total Sales =
VAR CustGroup = IF(
[SelectedGroup] = SELECTEDVALUE(
Dim_CustomerGroup[Cusomter_Group]),“Yes”, “No”)
Return
CALCULATE(
[Total Sales],
ALL( Dim_Customer[Cust_NAME] ),
CustGroup = “Yes”,
FILTER( Dim_City, Dim_City[City_name] = “Toronto”)
)

It doesn’t work. Any ideas?

Thanks in advance,

Wendy

@WendyZhang ,

I did a video recently that dealt with a very similar question. The breakdown of that particular problem starts at around the 8:40 mark of the video below. If this doesn’t adequately address your question after watching it, please provide a PBIX in progress file, and I would be happy to work with you on a specific solution.

Thanks.

– Brian

Thank you so much Brain. I’ll view the video and let you know if I could resolve the issue.

Wendy

1 Like

Hi Brain,

I don’t think I figured out the DAX expression to be used in my case. Still trying wrap my head round the virtual table.

Wendy

@WendyZhang ,

No worries – please just post your current PBIX file and I’ll be glad to work through the specific DAX with you.

– Brian

Thank you Brian.

I’ll prepare a mock-up file and looking forward to learning from you.

Wendy

1 Like

@WendyZhang ,

FYI – we have some great free tools available for the creation of mock datasets, in addition to the masking techniques for your actual data file. Check out the thread below which provides links to all of them:

– Brian

Thank you for sharing. Will try it out.

Wendy

Hi @WendyZhang did the response provided by @BrianJ help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query.

I hope that you are having a great experience using the Support Forum so far. Kindly take time to answer the Enterprise DNA Forum User Experience Survey, we hope you’ll give your insights on how we can further improve the Support forum. Thanks!

The issue is not resolved yet but for now I’ll put it on hold as there are other priorities to work on.

I may get back to it later if the issue is still not fixed.

Thank you all,

Wendy

@WendyZhang,

Okay, thanks for the update. I will just wait to receive the mockup file if you want to get back to this issue at some point.

– Brian

1 Like

Hi @WendyZhang, we’ve noticed that no response has been received from you since the 14th of June. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.

Hi @WendyZhang, due to inactivity, a response on this post has been tagged as “Solution”. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box.

Kindly take time to answer the Enterprise DNA Forum User Experience Survey, we hope you’ll give your insights on how we can further improve the Support forum. Thanks!