Forum Discussion
gbrenner35
4 years agoFrequent Visitor
Sort Month Year String Chronologically
Hi, I am using Power Pivot and I am trying to sort the column DateFirstPurchase by Month and Year String chronologically, in an independent column. Currently, I am able to do it in my pivot tabl...
- 4 years ago
Hi gbrenner35 ,
If you use format conversion directly, the field type of the created column is Text, and you need to use the value function to convert it to a numeric type.
FORMAT('Table'[Month Year String],"YYYYMM")Col_Format = VALUE(FORMAT('Table'[Month Year String],"YYYYMM"))
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
gbrenner35
4 years agoFrequent Visitor
Hi Theo,
I turned month year into a string when I did folloiwng steps, but now it will not let me turn my text into a whole number. Should I have generated month year a different way?
=Format(Customers[DateFirstPurchase], "MMM YY")
Attached is what I see in Power Pivot.
Thank you,
Greg
TheoC
4 years agoCommunity Champion
Hi gbrenner35
Can you modify that to:
= VALUE( FORMAT ( Customers[DateFirstPurchase] , "MMM YY") ) )