Forum Discussion
nalingupta94
2 years agoFrequent Visitor
Finding required date.
Hi all, I am fairly new to powerBI, and am still trying to figure out a lot of it's functioning. I am working on generating a report, and one of the requirements is to replace a date. Below is a ...
- 2 years ago
Hi
This calculated column formula works
Column = if(and(Data[Code]="1",Data[Checking year]=Data[Year]),LOOKUPVALUE(Data[Date],Data[Monnth number],CALCULATE(MIN(Data[Monnth number]),FILTER(Data,Data[Checking year]=EARLIER(Data[Year])&&Data[Code]="1"&&Data[Monnth number]=3)),Data[Checking year],Data[Year],Data[Code],"1"),LOOKUPVALUE(Data[Date],Data[Monnth number],8,Data[Checking year],Data[Year],Data[Code],"2"))
Ashish_Mathur
2 years agoSuper User
Hi
This calculated column formula works
Column = if(and(Data[Code]="1",Data[Checking year]=Data[Year]),LOOKUPVALUE(Data[Date],Data[Monnth number],CALCULATE(MIN(Data[Monnth number]),FILTER(Data,Data[Checking year]=EARLIER(Data[Year])&&Data[Code]="1"&&Data[Monnth number]=3)),Data[Checking year],Data[Year],Data[Code],"1"),LOOKUPVALUE(Data[Date],Data[Monnth number],8,Data[Checking year],Data[Year],Data[Code],"2"))
- nalingupta942 years agoFrequent Visitor
Thanks so much Ashish_Mathur.
Worked like a charm. - nalingupta942 years agoFrequent Visitor
Hi Ashish_Mathur , just out of curiosity, is there a way to manage lookupvalue, if it returns multiple dates with the selected month?
- Ashish_Mathur2 years agoSuper User
Share data in a format that can be pasted in an MS Excel file and show the expected result with an explanation.
- nalingupta942 years agoFrequent Visitor
Hey Ashish_Mathur, Please find the data attached:
Check year
Code
Date
Final Date
2019 1 1/01/2019 27/03/2019 2019 1 1/02/2019 27/03/2019 2019 1 3/03/2019 27/03/2019 2019 1 27/03/2019 27/03/2019 2019 1 27/05/2019 27/03/2019 2019 1 3/06/2019 27/03/2019 2019 1 25/06/2019 27/03/2019 2019 2 1/07/2019 28/08/2019 2019 2 25/07/2019 28/08/2019 2019 2 3/08/2019 28/08/2019 2019 2 28/08/2019 28/08/2019 2019 2 9/09/2019 28/08/2019 2019 2 11/09/2019 28/08/2019 2019 2 12/12/2019 28/08/2019 2020 1 1/01/2020 26/03/2020 2020 1 1/02/2020 26/03/2020 2020 1 3/03/2020 26/03/2020 2020 1 26/03/2020 26/03/2020 2020 1 27/05/2020 26/03/2020 2020 1 3/06/2020 26/03/2020 2020 1 25/06/2020 26/03/2020 2020 2 1/07/2020 25/08/2020 2020 2 25/07/2020 25/08/2020 2020 2 3/08/2020 25/08/2020 2020 2 25/08/2020 25/08/2020 2020 2 9/09/2020 25/08/2020 2020 2 11/09/2020 25/08/2020 2020 2 12/12/2020 25/08/2020 2021 1 1/01/2021 20/03/2021 2021 1 1/02/2021 20/03/2021 2021 1 3/03/2021 20/03/2021 2021 1 20/03/2021 20/03/2021 2021 1 27/05/2021 20/03/2021 2021 1 3/06/2021 20/03/2021 2021 1 25/06/2021 20/03/2021 2021 2 1/07/2021 29/08/2021 2021 2 25/07/2021 29/08/2021 2021 2 3/08/2021 29/08/2021 2021 2 29/08/2021 29/08/2021 2021 2 9/09/2021 29/08/2021 2021 2 11/09/2021 29/08/2021 2021 2 12/12/2021 29/08/2021 Explanation: If the Code is 1, select the MAX date March, where 'check year' = final date[year].
If the code is 02 select the MAX date in August where 'check year' = final date[year].
Please let me know if youd like any additional information.