March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I have one column which contains version of softwares like below
3.1.7.12
3.1.7.14
2.6.5
2.6.8
27.4.12.8
and so on...
My question is how can I format each numbers between two points to have every time 2 digits ? So:
03.01.07.12
03.01.07.14
02.06.05
02.06.08
27.04.12.08
Is it possible to do that with dax formulas ?
Sébastien
Solved! Go to Solution.
Hi @Hussard,
Based on my test, you could refer to below steps:
Sample data:
Create 5 columns:
B = IF(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 1)=BLANK(),BLANK(),IF(LEN(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 1))<2,"0"&PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 1),PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 1)))
C = IF(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 2)=BLANK(),BLANK(),IF(LEN(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 2))<2,".0"&PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 2),PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 2)))
D = IF(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 3)=BLANK(),BLANK(),IF(LEN(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 3))<2,".0"&PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 3),"."&PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 3)))
E = IF(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 4)=BLANK(),BLANK(),IF(LEN(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 4))<2,".0"&PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 4),"."&PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 4)))
New A = Table2[B]&Table2[C]&Table2[D]&Table2[E]
Result :
You could also download the pbix file to have a view.
Regards,
Daniel He
Hi @Hussard
The following way you can get your solution easily.
I have given the Sample Pbix file link below. Hope this helps you.
Hi @Hussard
The following way you can get your solution easily.
I have given the Sample Pbix file link below. Hope this helps you.
Hi both,
Thanks a lot I tried both solutions and it suits me.
Regards
Sébastien
Hi @Hussard,
Based on my test, you could refer to below steps:
Sample data:
Create 5 columns:
B = IF(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 1)=BLANK(),BLANK(),IF(LEN(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 1))<2,"0"&PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 1),PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 1)))
C = IF(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 2)=BLANK(),BLANK(),IF(LEN(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 2))<2,".0"&PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 2),PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 2)))
D = IF(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 3)=BLANK(),BLANK(),IF(LEN(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 3))<2,".0"&PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 3),"."&PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 3)))
E = IF(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 4)=BLANK(),BLANK(),IF(LEN(PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 4))<2,".0"&PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 4),"."&PATHITEM(SUBSTITUTE('Table2'[A],".", "|"), 4)))
New A = Table2[B]&Table2[C]&Table2[D]&Table2[E]
Result :
You could also download the pbix file to have a view.
Regards,
Daniel He
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |