Question on Product Sales Scenario Webinar

Hello:

I viewed Sam’s “Product Sales Scenario” (Scenario Analysis Patterns = PBIX), this afternoon.

There was one aspect of the session I couldn’t grasp.

Essentially, Sam uses this session to discuss “what-if” parameters, in this case to examine the effect of Demand and Discounting changes on Sales and Profits.

He uses a slicer to permit users to select however many products they’d like to run through the what-if parameters.

He constructs a measure, “Discounted Sales”, containing a VAR to provide this list of product(s). I don’t see how the VAR makes the connection from the slicer to the DAX. I pasted in the measure below.

I appreciate that this is an arcane question, to say the least. Any insights you provide will be much appreciated.

Discounted Sales =

VAR

DiscountedProducts = INTERSECT( VALUES( Products[Product Name] ), ALL( Products[Product Name] ) )

RETURN

CALCULATE(

SUMX( Sales, ( Sales[Quantity] * (1 + [% Demand Change] ) * ( RELATED( Products[Current Price] ) * (1 + [Discounting Value] ) ) ) ),

DiscountedProducts )

Regards,

John Giles

@JohnG ,

When you are harvesting a single value from a slicer, you can use SELECTEDVALUE. But when you allow multi-select in the slicer, you need to harvest the values using VALUES. I set up a simple example, just selecting customer names and harvesting them via VALUES and then counting the rows in the values table (single column) and placing that in a card visual.

You’ll see in the gif below, that when nothing is selected it returns the entire customer name column, and then as I select multiple customers it dynamically adjusts.

So, in Sam’s variable, his VALUES(Product[Product Name] ) is allowing for multiple selection of product names.

I hope that answers your question.

– Brian

Hello Brian:

Thank you for the prompt response.

Regards,

John Giles

1 Like