Forum Discussion
calculate value based on different row
I have table with first four columns and need the 5th column "Check" as calculated column. based on following conditions.
1. Check if the project number is same, then check if the item is same and check if for stage "A", date is not blank then value in column check is 1 or else 0.
| Project No. | Item | Stage | Date | Check |
| A123 | Jar | P | 01/01/2020 | 1 |
| A123 | Jar | F | 05/01/2020 | 1 |
| A123 | Jar | A | 10/01/2020 | 1 |
| A123 | tel | P | 01/01/2020 | 0 |
| A123 | tel | F | 05/01/2020 | 0 |
| A123 | tel | A | 0 | |
| B123 | jet | P | 01/01/2020 | 1 |
| B123 | jet | F | 05/01/2020 | 1 |
| B123 | jet | A | 10/01/2020 | 1 |
| B123 | jar | P | 01/01/2020 | 0 |
| B123 | jar | F | 05/01/2020 | 0 |
| B123 | jar | A | 0 |
Thanks,
Nilesh
4 Replies
- amitchandakSuper User
Create a new column like
Column = if(ISBLANK(minx(filter(Sheet1,Sheet1[Project No.]=EARLIER(Sheet1[Project No.]) && Sheet1[Item]= EARLIER(Sheet1[Item]) && (Sheet1[Stage])="A" && Sheet1[Date]>=EARLIER(Sheet1[Date])),Sheet1[Date])),0,1)Refer : https://www.dropbox.com/s/pgtdjaphy92xfhd/431687.pbix?dl=0
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners/ba-p/890814
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p/881739
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601- nilesh_amrutkarHelper I
Hi amitchandak ,
Thanks a lot for the solution, I have 12 such date columns, and the value 1 or 0 which I am trying to get I want to use in conditional formatting.
What is the best way to create such multiple calculated column (1 each for 1 date column) or create 12 measures for each of column or can we create 1 measure for all these date columns.
Could you please help to formulate measure for both cases.
Thanks and Regards,
Nilesh Amrutkar
- amitchandakSuper User
Can you share a sample and conditions you need. It can be one column or mutiple column. Depend on what is the later usages.