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
ChristianRHouen
Helper III
Helper III

Pivoting maximum date for group

Hi all

 

I want to pivot my data by group and maximum data. See suggested solution below:

image.png

I'm not sure this is the correct approach to do it, but it was the one that seemed most logical to me.

 

Not 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

You should be able to do this with Power query. Refer the Screenshots below. 

Under Transform -> Group By -> Advanced (Radio Button)Under Transform -> Group By -> Advanced (Radio Button)

Under Operation-> Select the Date Column-> Select option MAX()Under Operation-> Select the Date Column-> Select option MAX()

Upon calculating the MAX Date Values. Not Select the Column and Click on UnpivotColumns Option.Upon calculating the MAX Date Values. Not Select the Column and Click on UnpivotColumns Option.

Best Regards,
Vignesh M

If what I suggested worked for you feel free to Drop a "Kudos" and Consider to "Accept as Solution" if I solved your Issue 🙂

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi,

 

You should be able to do this with Power query. Refer the Screenshots below. 

Under Transform -> Group By -> Advanced (Radio Button)Under Transform -> Group By -> Advanced (Radio Button)

Under Operation-> Select the Date Column-> Select option MAX()Under Operation-> Select the Date Column-> Select option MAX()

Upon calculating the MAX Date Values. Not Select the Column and Click on UnpivotColumns Option.Upon calculating the MAX Date Values. Not Select the Column and Click on UnpivotColumns Option.

Best Regards,
Vignesh M

If what I suggested worked for you feel free to Drop a "Kudos" and Consider to "Accept as Solution" if I solved your Issue 🙂

Thanks for you suggestion

 

I picked the pivot button instead of unpivot as that is the operation I am looking for.

 

I get this for the first step, which is correct:

image.png

 

I do however get the error message when I pivot the data:

"Expression.Error: We cannot convert the value null to type Text.
Details:
Value=
Type=[Type]"

 

I have looked through my data but there are no Null values.

 

Can you help?

hi, @ChristianRHouen 

You could try use Pivot column as below:

1.JPG

Result:

2.JPG

you could also add a new custom name that is ""Software" & [ID_software]" and use it for pivot column.

3.JPG

 

here is sample pbix file, please try it.

 

Best Regards,

Lin

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

Hi,

 

You will need to select the list of Columns that you want to Unpivot. Also, Check if the columns have null values. 

If you are still unsure about this, then Share this PBIX with me and I shall complete it for you.

 

Best Regards,
Vignesh M

If what I suggested worked for you feel free to Drop a "Kudos" and Consider to "Accept as Solution" if I solved your Issue 🙂

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.