Forum Discussion

topazz11's avatar
topazz11
Helper III
4 years ago
Solved

Display value with Month

Hello, I have a set of data with Actual Values in one column and Target Values in second column, for each month. I cannot figure out how to display those 2 values for each corresponding mon...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  topazz11 ,

    Here are the steps you can follow:

    1. Create measure.

    Measure =
    var _today=TODAY()
    var _value1=MAX('Table1'[Value1])
    var _value2=CALCULATE(SUM('Table2'[Value2]),FILTER(ALL(Table2),'Table2'[ID]=MAX('Table1'[ID])&&'Table2'[Date]=MAX('Table1'[Date])))
    return
    SWITCH(
        TRUE(),
    MONTH(MAX('Table1'[Date]))=MONTH(_today),
    IF(
        _value1>_value2,_value1,_value2)
    ,
    MONTH(MAX('Table1'[Date]))<MONTH(_today),_value1,
    MONTH(MAX('Table1'[Date]))>MONTH(_today),
    _value2
    )

    2. Result:

    If you need pbix, please click here.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly