Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Reference a Price from the same Table

Hi,   I am trying to achive a measure in which Price of the select the month should be displayed, if the Price is not available in that month then it should show case the Next available price   I...
  • v-yueyunzh-msft's avatar
    3 years ago

    Hi , Anonymous 

    According to your description, you want to achive a measure in which Price of the select the month should be displayed, if the Price is not available in that month then it should show case the Next available price.

    Here are the steps you can refer to :
    (1)This is my test data:

    I create a calendar table like this:

    (2)We can create a measure like this:

    Measure = var _slicer = MIN('Calendar'[Date])
    var _has_value =MAXX( FILTER( 'Table' , 'Table'[Date]=_slicer) , [Sales Price])
    var _no_value_date = MINX(  FILTER('Table' , 'Table'[Date]>_slicer) , [Date])
    var _no_value =MAXX( FILTER('Table' , 'Table'[Date] = _no_value_date) , [Sales Price])
    return
    IF(_has_value=BLANK(),_no_value,_has_value)

     

    (3)Then we can put the measure on the visual and we can meet your need:

     

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

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