Forum Discussion

hllary's avatar
hllary
New Member
4 years ago
Solved

Create column based on Time value in another column

I am trying to create a visual that will so how many items were inspected during a certain time period.     I'm thinking the easiest way to do this is create another column that will have Ti...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  hllary ,

    Here are the steps you can follow:

    1. Create calculated column.

    Flag =
    CALCULATE(MIN('Table'[TimeName]),filter('Table',[start]<=earlier('Table2'[date_insp_time]) &&[end]>= earlier('Table2'[date_insp_time])))
    
    
    New Column =
    var _count=
    COUNTX(FILTER( ALL('Table2'),'Table2'[Flag]=EARLIER('Table2'[Flag])),[Flag])
    return
    [Flag] &" "&_count&" Project"

    2. Result:

    Please click here for the pbix file

     

    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