Forum Discussion
Formula against a specific cell
Hi,
I have a formula I want to add to a report in PBI, however I have to refer to the previous months cell in excel and move along. What is a similar formula to this in PBI?
=IF(AND($I3="Optilite Special Protein Analyser",AO3<>"",$AL3<>AP$2),"",IF(AND($I3="Optilite Special Protein Analyser",$AL3=AP$2),$AN3,IF($AM3<AP$2,"",IF(AO3<>"",AO3,IF($AK3=AP$2,$AN3,"")))))
Thanks!
timward10 , Go to modelling tab and select Calculated column and paste this code there or share sample data with me
Hi bhanu_gautam, unable to upload sample data, so shared the table below. The formula doesn't work when adding it into the modelling tab.
Thanks
Product Name Revenue Start Date Item 1 Revenue Date Contract End Date Split Jan-25 Feb -25 Mar-25 April-25 May-25 Item 1 01 January 2025 01 April 2025 01 September 2025 1 1 Item 2 01 March 2025 01 August 2025 01 December 2025 105 105 Item 3 01 June 2025 01 September 2025 01 January 2026 4 4
5 Replies
- bhanu_gautam
Super User
timward10 , Try using DAX and create a calculated column
DAX
NewColumn =
IF (
AND (
Table[I] = "Optilite Special Protein Analyser",
Table[AO] <> BLANK(),
Table[AL] <> Table[AP]
),
BLANK(),
IF (
AND (
Table[I] = "Optilite Special Protein Analyser",
Table[AL] = Table[AP]
),
Table[AN],
IF (
Table[AM] < Table[AP],
BLANK(),
IF (
Table[AO] <> BLANK(),
Table[AO],
IF (
Table[AK] = Table[AP],
Table[AN],
BLANK()
)
)
)
)
) - timward10
Helper II
Sorry bhanu_gautam I should of been more discripitive as you've added tables into the above. I have not used DAX query before. Is there a way based on the below?
I have attached below the PBI report
This is excel report and formula I am trying to replicate.
=IF(AND($I3="Optilite Special Protein Analyser",AO3<>"",$AL3<>AP$2),"",IF(AND($I3="Optilite Special Protein Analyser",$AL3=AP$2),$AN3,IF($AM3<AP$2,"",IF(AO3<>"",AO3,IF($AK3=AP$2,$AN3,"")))))
- bhanu_gautam
Super User
timward10 , Go to modelling tab and select Calculated column and paste this code there or share sample data with me
- timward10
Helper II
Hi bhanu_gautam, unable to upload sample data, so shared the table below. The formula doesn't work when adding it into the modelling tab.
Thanks
Product Name Revenue Start Date Item 1 Revenue Date Contract End Date Split Jan-25 Feb -25 Mar-25 April-25 May-25 Item 1 01 January 2025 01 April 2025 01 September 2025 1 1 Item 2 01 March 2025 01 August 2025 01 December 2025 105 105 Item 3 01 June 2025 01 September 2025 01 January 2026 4 4