Forum Discussion
hllary
4 years agoNew Member
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...
- Anonymous4 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
Anonymous
4 years agoNot applicable
Hi hllary - I have created the following PBIX example to show how you can use Power Query syntax to find the Time Band. Sample File . Please note the range removes the +1 second from the time ranges.
- hllary4 years agoNew Member
Thanks for you help! This project is for work and they have an older version of power bi. Please post the the code to the power query. thanks