cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NickProp28
Post Partisan
Post Partisan

Filter condition and return to a new table

Dear Community,

 

NickProp28_0-1598235908242.png

Would like to use CALCULATETABLE to create a new table based on this main table. Need you guys help me on filter part.

If one job appear more than one time, the job which have MIN(ATD), MAX(Actual Felivery Date) and MAX (Posted) date will be selected. Only return one row for each of the job.

 

Example for B002, Peter job. Since there have complexity date, will priority on the row which having MIN(ATD). (12 March 2020)

Furthermore, if the column in null, will be consider is the lowerst date. 

 

Here is the pbix file: https://ufile.io/k1pj70ah

 

Thanks for your precious time on this matter.

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@NickProp28 - I would use SUMMARIZE or SUMMARIZECOLUMNS and not CALCULATETABLE. Something like:

 

Table =
  SUMMARIZE(
    'Table',
    [Job],
    "ATD",MIN([ATD]),
    "Actual Felivery Date",MAX([Actual Felivery Date]),
    "Posted",MAX([Posted])
  )

@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop!
Microsoft Hates Greg's Quick Measures
Check out my latest book!

View solution in original post

amitchandak
Super User
Super User

@NickProp28 , You need use summarize like

summarize ( Table, Table[Job], , Table[Operator], Table[Direction], Table[IncoTerms] ,"ATD" ,MIN(ATD), "Actual Delivery Date" , MAX(Actual Delivery Date), "Posted" MAX (Posted) )

 

or

summarize ( Table, Table[Job], , Table[Operator], Table[Direction],"ATD" ,MIN(ATD), "Actual Delivery Date" , MAX(Actual Delivery Date), "Posted" MAX (Posted) )

or

summarize ( Table, Table[Job], , Table[Operator] ,"ATD" ,MIN(ATD), "Actual Delivery Date" , MAX(Actual Delivery Date), "Posted" MAX (Posted) )

 

//depending on the need you can add remove group by and columns

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@NickProp28 , You need use summarize like

summarize ( Table, Table[Job], , Table[Operator], Table[Direction], Table[IncoTerms] ,"ATD" ,MIN(ATD), "Actual Delivery Date" , MAX(Actual Delivery Date), "Posted" MAX (Posted) )

 

or

summarize ( Table, Table[Job], , Table[Operator], Table[Direction],"ATD" ,MIN(ATD), "Actual Delivery Date" , MAX(Actual Delivery Date), "Posted" MAX (Posted) )

or

summarize ( Table, Table[Job], , Table[Operator] ,"ATD" ,MIN(ATD), "Actual Delivery Date" , MAX(Actual Delivery Date), "Posted" MAX (Posted) )

 

//depending on the need you can add remove group by and columns

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

View solution in original post

Dear @amitchandak , @Greg_Deckler 

 

Thanks for your attention and guide for my issues.

 

 

Greg_Deckler
Super User
Super User

@NickProp28 - I would use SUMMARIZE or SUMMARIZECOLUMNS and not CALCULATETABLE. Something like:

 

Table =
  SUMMARIZE(
    'Table',
    [Job],
    "ATD",MIN([ATD]),
    "Actual Felivery Date",MAX([Actual Felivery Date]),
    "Posted",MAX([Posted])
  )

@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop!
Microsoft Hates Greg's Quick Measures
Check out my latest book!

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!