Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Show values on Matrix based on range dimension

Hi, i need help with this visual   I have this matrix  Month -3 -2 -1 0 1 2 3 Total January 2.3 2.2 2.5 1.2 2.7 2.6 2.9 6.9 February 2.2 2.5 2.4 1.6 2.6 2.5   5.4 ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Solved it;

    Solution:

    1st - Create a measure to calculate the maximun month to harvest

    Max Harvest =
    var Months= CALCULATE(MAX(HARVEST[MONTHS]),HARVEST[DAYS] = MAX(FACT_TRANSACTION_GROWTH[DAYS]))
    return IF(Months> 0,Months)
     
    2nd - Create same measure, but remove harvest filters
    Max Harvest Fixed = CALCULATE([Max Harves],REMOVEFILTERS(HARVEST))
     
    3rd - Create a measure to calculate the minimun month to harvest
    Min Harvest =
    var Months= CALCULATE(MIN(HARVEST[MONTHS]),HARVEST[DAYS] = MAX(FACT_TRANSACTION_GROWTH[DAYS]))
    return IF(Months < 0 && Months > [Max Harvest Fixed] * -1,Months)
     
    4th - Create the final measure
    Measure  =
    var Months = CALCULATE(MAX(HARVEST[MONTHS]),HARVEST[DAYS] = MAX(FACT_TRANSACTION_GROWTH[DAYS]))
    return IF(Months >= [Min Harvest] && Months < [Max Harves Fixed],[Average Transaction])
     
    The visual: