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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sunny27
Frequent Visitor

Create a new data with Max of record

Hi,

 

How can we summarize the following data?

EmployeeNumberStatusDate
10011/1/2017
10022/1/2017
10033/1/2017
10044/1/2017
10114/25/2017
10125/25/2017
10223/10/2017
10324/10/2017
10415/10/2017
10516/10/2017
10617/10/2017
10628/10/2017
10639/10/2017
106410/10/2017

 

I want to display max(date) for the Employees. In this case the output will be:

 

EmployeeNumberStatusDate
10044/1/2017
10125/25/2017
10223/10/2017
10324/10/2017
10415/10/2017
10516/10/2017
106410/10/2017

 

 

How can we do this? I tried to summarize and Group by but it's not working.
I want to create a summary table that does this. So that I can use my measures to on top that summary table. Is there a way to create a new calculated table in Power BI to achieve the above result?

 

Using matrix visual will work but in that case I cannot create my own measures to leverage that data. I appreciate your time. Thanks!

7 REPLIES 7
v-jiascu-msft
Employee
Employee

Hi @sunny27,

 

 

Could you please mark the proper answers as solutions?

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Employee
Employee

Hi @sunny27,

 

The formula below will generate a calculated table. Please give it try. I assumed the orders of status and date are accordingly.

Table =
SUMMARIZE (
    'Table1',
    Table1[EmployeeNumber],
    "maxStatus", MAX ( 'Table1'[Status] ),
    "maxDate", MAX ( 'Table1'[Date] )
)

Create_a_new_data_with_Max_of_record

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

 

Share the final result you are expecting.  It could be possible that a formula can be written to get your result directly from the input Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @sunny27

 

Create a measure in DAX:

 

Max in group = IF(CALCULATE(MAX('Table1'[Date]),ALLEXCEPT('Table1','Table1'[EmpNo]))=MAX('Table1'[Date]),1,0)

and then apply filter for this measure to 1 as visual filter.

 

 

This calculation doesnt load into model, so its memory / performance effective.

 

Thanks
Raj

Hi Rajendran,

 

Thanks for replying but here is the thing, Is there a way to create a measure or Calculated field to find the latest status of a facility by Date.I tried using [Max in group] measure and tried filtering in visual but no use.

 

 

Thanks!

Hi @sunny27,

 

I created 2 simple measures ( for date and Status) and I put them in my report (Table), it seems to works

 

M_Status = CALCULATE(MAX(Data[Status]))
M_Date = CALCULATE(MAX(Data[Date]))

Hope it helps...

 

Ninter

Anonymous
Not applicable

Goto Edit QueriesCapture.PNG

and Try this 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.