Forum Discussion

MeloKutman's avatar
MeloKutman
Frequent Visitor
7 years ago
Solved

Merge tables and measure based on selected range

Hi all,   I am trying to do something simple (I guess) but a bit tricky and I cannot find the rigth solution.    I have two different tables (these are a simplification...). PLAN: Product.P ...
  • Stachu's avatar
    7 years ago

    I'd actually model it a bit differently, using Append (the product & date need to have the same name for append to work like this), so in the end I would have this table:

     

    ProductDateActual PricePlanned price
    Bike 601 August 2018100 
    Bike 701 August 2018100 
    Bike 801 October 2018100 
    Bike 901 September 2018100 
    Bike 1001 October 2018100 
    Bike 1101 October 2018100 
    Bike 1201 October 2018100 
    Bike 1301 October 2018100 
    Bike 1401 October 2018100 
    Bike 101 August 2018 100
    Bike 201 August 2018 100
    Bike 301 September 2018 100
    Bike 401 October 2018 100
    Bike 501 September 2018 100
    Bike 601 August 2018 100
    Bike 701 September 2018 100
    Bike 801 September 2018 100
    Bike 901 September 2018 100

    as you want the values to be dynamic depending on the slicer you need to use a measure (column is always static):

    Plan Achieved = 
    VAR Planned = MAX(Data[Planned price]) VAR Actual = MAX(Data[Actual Price]) RETURN IF( ISBLANK(Planned), 3, IF( ISBLANK(Actual), 1, 2 ) )