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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
PowerRobots99
Helper II
Helper II

Power Query Custom Column Calculation

Hello Everyone,

 

I am having weekly data in attached sheet with column ("Report Date" to "Completed Week") which i have imported in Power BI.

Now, i have to develop custom column "In Prior Weeks Schedule?" and "Completed on Schedule?" in Power BI's power query.

(Logic is as explained by using excel formulas below for the calculation).

 

We have to compare each WO in current reporting week with last reporting week.

Is there any way to achive this?

  

Screenshot 2024-05-10 165701.png

 

In Prior Weeks Schedule? =IF(

SUMIFS([WO'#],
[BU],[@BU],
[WO'#],[@[WO'#]],
[Report Week],[@[Report Week]]-1,
[Schedule Week],[@[Report Week]]-1)

=[@[WO'#]],1,0)

 

 

Completed on Schedule=IF(

AND([@[In Prior Weeks Scheudle?]],
[@[Completed Week]]=[@[Report Week]]-1),1,0)

1 ACCEPTED SOLUTION

3 REPLIES 3
AngeloParana
Resolver I
Resolver I

Create a custom key and do self join on the previous table.

 

key is like thise (reportweek-1) + WO#

@AngeloParana 

 

Thank you for your reply,

I have uploaded excel file and .pbix file for your reference,

 

https://drive.google.com/file/d/11Ml22csv7DTZX-Ck16mpQ1u0aTdzDWP7/view?usp=drive_link

 

https://docs.google.com/spreadsheets/d/1aMBa5f54oMcYgWinr0S69k4jSP1OK4K9/edit?usp=drive_link&ouid=10...

 

Could you please incorporate solution and share the. pbix file

 

Thank you,

PowerRobots

Hi, here you go

PBIX File 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.