Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Data segmentation date as DAX formula

Greetings I have a problem with a table, the calculation of one of its columns depends on an arbitrary date, for example: Column-if(date-"10-09-2020",1,0) I need to analyze and graph this tab...
  • v-zhenbw-msft's avatar
    5 years ago

    Hi Anonymous ,

     

    We can create a date table to be the arbitrary date and create a measure to meet your requirement.

     

    1. Create a date table, then create a slicer using it.

     

    Date = CALENDARAUTO()

     

     

    2. Then we can create a measure to get the result.

     

    Column-if = 
    var _select = SELECTEDVALUE('Date'[Date])
    var _condition = IF(_select=MAX('Table'[Date]),1,0)
    return
    SUM('Table'[value]) * _condition
    

     

     

     

    If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data?

    It will be helpful if you can show us the exact expected result based on the tables.

     

    Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

     

    Best regards,

     

    Community Support Team _ zhenbw

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

     

    BTW, pbix as attached.