Forum Discussion

jmcph's avatar
jmcph
Icon for Helper III rankHelper III
5 years ago
Solved

What if slicer problems

Hi. I am having a issues when slicing between 2 Categories in a "What if" scenario but it works fine if i only slice in 1 Category.

My Category slicer is independent from any tables named 'Slicer Category Qty'

To illustrate please see screenshots: 

 

Slicing with 1 Category (Works fine) - Selected Category: Cheeseburgers 

 

However when i slice thru with more than 1 category, it reverts back to the original value: 

 

Both beverage and cheeseburger are in their original value. 

 

My measure for Sales Qty Forecast : 

 

Sales Qty Forecast =
Calculate(
    [SalesQty] * (1 + [Forecast Qty Value] ) ,
              Filter ( Productlist , Productlist[Category] = Selectedvalue ( 'Slicer Category Qty'[Category Qty] ))) +
                    Calculate( [SalesQty] ,
                         Filter ( Productlist , Productlist[Category] <> Selectedvalue ( 'Slicer Category Qty'[Category Qty] )))
 
Am i missing something? Or is there something wrong with the measure? 
Thank you for helping! ! 
  • jmcph , Try like


    Sales Qty Forecast =
    Calculate(
    [SalesQty] * (1 + [Forecast Qty Value] ) ,
    Filter ( Productlist , Productlist[Category] in allselected ( 'Slicer Category Qty'[Category Qty] ))) +
    Calculate( [SalesQty] ,
    Filter ( Productlist , not(Productlist[Category] in allselected ( 'Slicer Category Qty'[Category Qty] ))))

    or
    Sales Qty Forecast =
    Calculate(
    [SalesQty] * (1 + [Forecast Qty Value] ) ,
    Filter ( Productlist , Productlist[Category] in values ( 'Slicer Category Qty'[Category Qty] ))) +
    Calculate( [SalesQty] ,
    Filter ( Productlist , not(Productlist[Category] in values ( 'Slicer Category Qty'[Category Qty] ))))

2 Replies

  • jmcph , Try like


    Sales Qty Forecast =
    Calculate(
    [SalesQty] * (1 + [Forecast Qty Value] ) ,
    Filter ( Productlist , Productlist[Category] in allselected ( 'Slicer Category Qty'[Category Qty] ))) +
    Calculate( [SalesQty] ,
    Filter ( Productlist , not(Productlist[Category] in allselected ( 'Slicer Category Qty'[Category Qty] ))))

    or
    Sales Qty Forecast =
    Calculate(
    [SalesQty] * (1 + [Forecast Qty Value] ) ,
    Filter ( Productlist , Productlist[Category] in values ( 'Slicer Category Qty'[Category Qty] ))) +
    Calculate( [SalesQty] ,
    Filter ( Productlist , not(Productlist[Category] in values ( 'Slicer Category Qty'[Category Qty] ))))

    • jmcph's avatar
      jmcph
      Icon for Helper III rankHelper III

      Works perfectly! Thank you!