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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Sharma0815
Helper II
Helper II

Pivot Max date with final status of case

 I am working on dataset where each case contains multiple rows with the status that it went through,i am trying to pivot the max(time_stamp) of my final_decision_time and the final_status of case by the Group.

 

here is my data looks like,

 

CaseWCF_Approv_DecisWCF_Approv_Decis_DateCSA_Approv_DecisCSA_Approv_Decis_DateRSA_Approv_DecisRSA_Approv_Decis_DateFSB_Approv_DecisFSB_Approv_Decis_Date
386646 NULL NULLApproved3/3/2020 15:24 NULL
386646 NULLApproved2/27/2020 16:37 NULL NULL
386646Rejected2/19/2020 17:30 NULL NULL NULL
397142 NULL NULLApproved5/29/2020 18:58 NULL
397142 NULLApproved5/29/2020 18:34 NULL NULL
397142Rejected5/29/2020 13:40 NULL NULL NULL

 

I am trying to get an extra columns with the final_decision_date with status of the case like below.

 

Any way that i can pivot this data by using @dax

 

CaseWCF_Approv_DecisWCF_Approv_Decis_DateCSA_Approv_DecisCSA_Approv_Decis_DateRSA_Approv_DecisRSA_Approv_Decis_DateFSB_Approv_DecisFSB_Approv_Decis_DateFina_DecisionFinal_Decision_Date
386646 NULL NULLApproved3/3/2020 15:24 NULLApproved3/3/2020 15:24
386646 NULLApproved2/27/2020 16:37 NULL NULLApproved3/3/2020 15:24
386646Rejected2/19/2020 17:30 NULL NULL NULLApproved3/3/2020 15:24
397142 NULL NULLApproved5/29/2020 18:58 NULLApproved5/29/2020 18:58
397142 NULLApproved5/29/2020 18:34 NULL NULLApproved5/29/2020 18:58
397142Rejected5/29/2020 13:40 NULL NULL NULLApproved5/29/2020 18:58

 

1 ACCEPTED SOLUTION

@Sharma0815 

 

Please check if your date column's data type is Text? If so, please convert it to date and try again.

 





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

Proud to be a Super User!




View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@Sharma0815 , try like

new measure =calculate(max(Table[RSA_Approv_Decis_Date]),allexcept(Table[Case]))

 

You can add additional condition

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
ryan_mayu
Super User
Super User

@Sharma0815 

 

I am not sure if RSA is always the latest status.

 

you can try below measures.

Column2 = MAXX(FILTER('Sheet11','Sheet11'[Case]=EARLIER(Sheet11[Case])),'Sheet11'[RSA_Approv_Decis_Date])

column 1 = MAXX(FILTER('Sheet11','Sheet11'[Case]=EARLIER('Sheet11'[Case])&&'Sheet11'[Column2]='Sheet11'[RSA_Approv_Decis_Date]),'Sheet11'[RSA_Approv_Decis])

1.PNG





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

Proud to be a Super User!




@ryan_mayu  RSA  is not always be the finla status 

@Sharma0815 

 

Since lastest update of all the sample data  you provided was RSA related, if RSA is not the final status, then formula of the method I provided will be very long.

check FSB, if FSB is null, then check RSA, if RSA is null, check CSA, if CSA is null ,check WCF.

 

 





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

Proud to be a Super User!




I will add a conditional statement to get the final status ...,

 

when i try to use your column2 caluclation, i am getting value comparison error 

 

Error

DAX comparison operations do not support comparing values of type Text with values of type Date. Consider using the VALUE or FORMAT function to convert one of the values.

 

Thanks alot

@Sharma0815 

 

Please check if your date column's data type is Text? If so, please convert it to date and try again.

 





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

Proud to be a Super User!




Thanks alot ,appreciated

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors