cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Katek10
Regular Visitor

Retrieve the values from a column based on earliest date column for each row it applies

Dear Community, 

            This time I have situation when I need to extract in a visual the earliest status for each hostname in an action and per each SW that needs to be installed on respective hostnames. 

            I've tried CALCULATE(

                                            MAX(MyTable[action_id];

                                            FILTER( ALLEXCEPT(MyTable; MyTable[action_name]);

                                                         MyTable[action_start = MAX( MyTable[action_start])))

but I've got an error with MAX function due to the fact that referring to a column with multiple entries (duplicate per server and SW - each action has few SW applied to multiple hostnames). And here I got lost - I've been trying to figure this out adding a COUNT or SUM function before MAX, but seems I was again doomed to fail.

         Enclosed below a sample of my data set and desired outcome.

 

Sample

SampleTable1.png

Outcome

SampleOutputTable1.png

 

Many thanks in advance for your feedback and support!

K

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: Retrieve the values from a column based on earliest date column for each row it applies

Create this measure and put it visual level filter

Measure 3 = 
var __id = min(Sheet1[hostname])
var __date = CALCULATE(max(Sheet1[action_start]),ALLSELECTED(Sheet1),Sheet1[hostname]=__id)
return
CALCULATE(COUNT(Sheet1[action_id]),VALUES(Sheet1[hostname]),Sheet1[hostname]=__id , Sheet1[action_start]=__date)

 

Link : https://www.dropbox.com/s/bqd9vxp97cgm2u6/firstAction.pbix?dl=0

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin





Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
In case it does not help, please provide additional information and mark me with @
My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP,
HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Super User! Linkedin


View solution in original post

3 REPLIES 3
Katek10
Regular Visitor

Re: Retrieve the values from a column based on earliest date column for each row it applies

Adding a OneDrive link to enclosed data set: https://1drv.ms/u/s!AvcPl6Zol8otgs4oJbydjMIcKjtHTg?e=rbjbXv.

Super User IV
Super User IV

Re: Retrieve the values from a column based on earliest date column for each row it applies

Create this measure and put it visual level filter

Measure 3 = 
var __id = min(Sheet1[hostname])
var __date = CALCULATE(max(Sheet1[action_start]),ALLSELECTED(Sheet1),Sheet1[hostname]=__id)
return
CALCULATE(COUNT(Sheet1[action_id]),VALUES(Sheet1[hostname]),Sheet1[hostname]=__id , Sheet1[action_start]=__date)

 

Link : https://www.dropbox.com/s/bqd9vxp97cgm2u6/firstAction.pbix?dl=0

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin





Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
In case it does not help, please provide additional information and mark me with @
My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP,
HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Super User! Linkedin


View solution in original post

Katek10
Regular Visitor

Re: Retrieve the values from a column based on earliest date column for each row it applies

Hello Amit, 

 

            Like always, simply brilliant! Many thanks Amit, words can't describe how much I appreciate your help (once again)!

 

Cheers,

K

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors