Power BI Builds 5 - Optical Data

Hi @kurzashane,

Give this a go, just paste the code into a new blank query.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtA1VdJRMlSK1YlWMtM1NAByjMAcQ0NtINtYKTYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Canine lifespan" = _t, #"Sort Order" = _t]),
    AddLists = Table.AddColumn(Source, "Years", each if [Sort Order] ="1" then {0..5} else if [Sort Order] ="2" then {6..10} else {11..30})[[Canine lifespan], [Years]],
    ExpandYears = Table.ExpandListColumn(AddLists, "Years")
in
    ExpandYears 

.
Adjust according to your own needs.
I hope this is helpful

2 Likes

Worked like a charm! Thanks!

I did receive an stating it was looking for ā€œinterval of Monthsā€ and when I altered the code I got an array issue.

Hi @kurzashane,

It will be hard to provide assistance without a file and more detailsā€¦
Please create a new topic and supply a sample PBIX (with mockup data file XLSX)

Thanks!

Hi Olga, are you needing help with anything in particular?

No, thanks. I am testing new functionality we are applying on the On-Demand portal =)

1 Like