Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
PowerRobots99
Regular Visitor

PowerQuery - Checking if values are present in previous report date

Hello Everyone,

 

Please refer .PBIX file - File

 

In power query, we have to find out if WO is present in previous reporting date, if present then it should give True else False

Is there any way to achive this ?

 

Input - 

 

PowerRobots99_0-1715750449325.png

 

Output - 

 

Report DateReport WeekWO#Output_IsInPreviousReportDate?
28-04-2024181 
28-04-2024182 
28-04-2024183 
28-04-2024184 
28-04-2024185 
28-04-2024186 
28-04-2024187 
28-04-2024188 
28-04-2024189 
28-04-20241810 
06-05-2024191TRUE
06-05-2024192TRUE
06-05-2024193TRUE
06-05-20241912FALSE
06-05-20241917FALSE
06-05-2024196TRUE
06-05-20241989FALSE
06-05-2024198TRUE
06-05-20241915FALSE
06-05-20241918FALSE
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @PowerRobots99 

 

Do the following steps:

  • Do a group by Report Date - All rows
  • Add an index column starting in 1
  • Expand all columns except for date
  • Add a new column with the following code
if  [Index] = 1 then null else if Table.RowCount(

Table.SelectRows(
Table.SelectRows(#"Expanded Count",(x) => x[Index] = [Index]-1) , (y) => y[#"WO#"] = [#"WO#"])) = 1 then true else false

MFelix_0-1715792124305.png

File attach.

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @PowerRobots99 

 

Do the following steps:

  • Do a group by Report Date - All rows
  • Add an index column starting in 1
  • Expand all columns except for date
  • Add a new column with the following code
if  [Index] = 1 then null else if Table.RowCount(

Table.SelectRows(
Table.SelectRows(#"Expanded Count",(x) => x[Index] = [Index]-1) , (y) => y[#"WO#"] = [#"WO#"])) = 1 then true else false

MFelix_0-1715792124305.png

File attach.

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.