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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
Anonymous
Not applicable

summarize table and add new columns

Apologies for the poor formating of this post, I am having web page issues. I will separate paragraphs with #-#. #-# I have a tall table composed of an ID, status, and the date the ID entered the status #-# #-# I want to create a short table which one row corresponds to a single ID, and each column represents the maximum date value for the specific status #-# #-# I am thinking of using Summarize, but do not know how to calculate the maximum date for each specific status#-# #-# I hope power bi can fix their web page
1 ACCEPTED SOLUTION

Hi @Anonymous,

 

For your logic, you could try this measure below.

 

 

currency =
VAR maxdate =
    CALCULATE ( MAX ( 'Table1'[DATE] ), ALLEXCEPT ( Table1, Table1[ID] ) )
RETURN
    CALCULATE ( MAX ( 'Table1'[Status] ), FILTER ( 'Table1', 'Table1'[date] = maxdate ) )

In addition, it seems that your desired output is like a matrix in Power BI. 

 

However, I'm afraid that we may not achieve that the same output like your desired output in Power BI. 

 

The most we can achieve is like below.

 

result.PNG 

 

You also could have a reference of the attachment.

 

Best  Regards,

Cherry

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

View solution in original post

6 REPLIES 6
ryan_mayu
Super User
Super User

@Anonymous

 

Please see if this is what you want. Thanks.

 

Table = FILTER(SUMMARIZE(Sheet26,Sheet26[ID],Sheet26[STATUS],"MAXDATE",MAX('Sheet26'[DATE])),Sheet26[STATUS]="##")

c1.JPG

 

 

c2.JPG





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

Proud to be a Super User!




Anonymous
Not applicable

That is very close ryan!! You are a star for deciphering this. 

 

I have:

 

Capture.PNG

 

I want (columns 1-5 are teh status, and the last column is the current status):

 

Capture2.PNG

@Anonymous

 

Is this ok for your?

testtable = SUMMARIZE(Sheet26,Sheet26[ID],Sheet26[STATUS],"MAXDATE",CALCULATE(MAX('Sheet26'[DATE]),ALLEXCEPT(Sheet26,Sheet26[ID],Sheet26[STATUS])))

 

c1.JPGc2.JPG




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

Proud to be a Super User!




Anonymous
Not applicable

Yes, the table on the right is the one that I want to make.

 

As a standalone table, as further calculations will be performed on that table

Hi @Anonymous,

 

For your logic, you could try this measure below.

 

 

currency =
VAR maxdate =
    CALCULATE ( MAX ( 'Table1'[DATE] ), ALLEXCEPT ( Table1, Table1[ID] ) )
RETURN
    CALCULATE ( MAX ( 'Table1'[Status] ), FILTER ( 'Table1', 'Table1'[date] = maxdate ) )

In addition, it seems that your desired output is like a matrix in Power BI. 

 

However, I'm afraid that we may not achieve that the same output like your desired output in Power BI. 

 

The most we can achieve is like below.

 

result.PNG 

 

You also could have a reference of the attachment.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

The table you made in the visual on the right is the final table I want to generate via DAX calculation, as computations will be performed on that.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.