Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello all,
I am trying to manage iOS versions within PowerBI - These numbers have two decimals within them "17.5.0" i believe this fact is causing some discrepancies when attempting to convert them to numbers.
As seen here:
Is there anyway to convert these versions into number, so i can start comparing with previous versions / versions avaliable / higher and lower visuals. Thanks for all your help.
Solved! Go to Solution.
Hi @RamenAnalytics ,
Pls has your problem been solved? If so, accept the reply as a solution. This will make it easier for the future people to find the answer quickly.
I reviewed it and I tried to reproduce it. I found that in excel, like "17.5.0" could be set up as number type.
I think you want to do the same as in Power BI Desktop, right?
However, you can't do this way in Desktop as it is by default.
After testing, the text format "xx.x.x" can also be compared in size. As follows, the results of comparing the size are normal. I added a custom column that returns 1 if [device_os_version] is larger than [device_os_version2], otherwise it returns 0.
Hope this helps.
Best Regards,
Stephen Tao
Hi @RamenAnalytics ,
Pls has your problem been solved? If so, accept the reply as a solution. This will make it easier for the future people to find the answer quickly.
I reviewed it and I tried to reproduce it. I found that in excel, like "17.5.0" could be set up as number type.
I think you want to do the same as in Power BI Desktop, right?
However, you can't do this way in Desktop as it is by default.
After testing, the text format "xx.x.x" can also be compared in size. As follows, the results of comparing the size are normal. I added a custom column that returns 1 if [device_os_version] is larger than [device_os_version2], otherwise it returns 0.
Hope this helps.
Best Regards,
Stephen Tao
Hi @RamenAnalytics
How many digits can there be after a decimal point? For example can 17.6.0 go to 17.66.01? Also, what do yo mean by higher and lower visuals?
You can create a new column with a DAX formula that removes decimals:
WholeNumber = INT(SUBSTITUTE('Table'[YourColumn], ".", ""))
For example, "17.5.0" would become "1750".
If this helped, a Kudos 👍 or Solution mark would be great!
Cheers,
Kedar Pande
www.linkedin.com/in/kedar-pande
Hi there!
The version numbers like "17.5.0" are causing issues because of the multiple decimal points. Here are a couple of ways you could convert them to numbers for comparison:
1. **Remove Dots**: You can simply replace the dots with nothing to create a continuous numeric value. For example, in Power Query, you can do this:
```M
let
Source = ...,
ReplacedDots = Text.Replace([Version], ".", ""),
VersionNumber = Number.FromText(ReplacedDots)
in
VersionNumber
```
This will convert "17.5.0" into "1750", which makes it easier to compare versions as numbers.
2. **Convert to a Decimal Format**: Another option is to convert each part of the version number into a numeric representation, combining them into a decimal value:
```M
let
Source = ...,
SplitVersion = Text.Split([Version], "."),
Major = Number.FromText(SplitVersion{0}),
Minor = Number.FromText(SplitVersion{1}),
Patch = Number.FromText(SplitVersion{2}),
Combined = Major + Minor / 10 + Patch / 100
in
Combined
```
This way, "17.5.0" would become something like "17.50", retaining the meaning of the individual parts.
Either of these approaches should help you compare the versions without the discrepancies caused by the dots.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
User | Count |
---|---|
76 | |
74 | |
45 | |
31 | |
27 |
User | Count |
---|---|
99 | |
91 | |
51 | |
48 | |
47 |