Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
CEllis
Resolver I
Resolver I

Increment List to by 0.01 to 2 decimal places

Think I have nearly got it just cant quite work out the last bit, any help appreciated.

I am trying to increment the range so that it shows increment of 0.01 the PAG table is the list and the second table is the output.

What I ideally need is to get  0.01,  0.02  .....  1.21,  1.22,  1.23 etc....

 

 

 

let
  Source = PAG,
  #"Changed column type" = Table.TransformColumnTypes(Source, {{"Start Range", type number}, {"Finish Range", type number}}),
  List = Table.AddColumn(#"Changed column type", "Key Stage 1 Average PAG", each List.Numbers([Start Range], Number.Round(([Finish Range]-[Start Range])*10+0.1),0.1)),
  #"Expanded Key Stage 1 Average PAG" = Table.ExpandListColumn(List, "Key Stage 1 Average PAG")
in
  #"Expanded Key Stage 1 Average PAG"

 

 

 

PAG Table

GroupStart RangeFinish RangeReading(PAG)Writing(PAG)Maths(PAG)
10.0000011.49999962.8462.5663.05
21.50000011.749999967.7567.1167.84
31.75000011.99999970.669.3370.8
42.00000012.99999973.6572.2774.13
533.24999980.3277.8580.49
63.253.49999982.0879.4182.23
73.53.74999985.7482.4685.37
83.753.99999988.5384.5188.05
94490.5186.6689.38
104.0000014.99999992.2487.8692.18
115594.2289.7793.38
125.0000015.99999995.5890.3395.1
136696.7893.0195.81
146.0000016.999999100.8596.3597.86
1577101.0497.37100.93
167.0000017.999999103.2998.23102.84
1788105.38102.02104.61
188.0000019.499999109.5104.72107.85
199.59.999999111.29105.5110.84
201010113.29108.88112.15

The output doesnt increment by 0.01 

PAG GroupStart RangeFinish RangeReading(PAG)Writing(PAG)Maths(PAG)Key Stage 1 Average PAG
10.0000011.49999962.8462.5663.050.000001
10.0000011.49999962.8462.5663.050.100001
10.0000011.49999962.8462.5663.050.200001
10.0000011.49999962.8462.5663.050.300001
10.0000011.49999962.8462.5663.050.400001
10.0000011.49999962.8462.5663.050.500001
10.0000011.49999962.8462.5663.050.600001
10.0000011.49999962.8462.5663.050.700001
10.0000011.49999962.8462.5663.050.800001
10.0000011.49999962.8462.5663.050.900001
10.0000011.49999962.8462.5663.051.000001
10.0000011.49999962.8462.5663.051.100001
10.0000011.49999962.8462.5663.051.200001
10.0000011.49999962.8462.5663.051.300001
10.0000011.49999962.8462.5663.051.400001
21.51.7567.7567.1167.841.5
21.51.7567.7567.1167.841.6
21.51.7567.7567.1167.841.7
31.751.99999970.669.3370.81.75
31.751.99999970.669.3370.81.85

 

Through to

PAG GroupStart RangeFinish RangeReading(PAG)Writing(PAG)Maths(PAG)Key Stage 1 Average PAG
188.0000019.499999109.5104.72107.858.200001
188.0000019.499999109.5104.72107.858.300001
188.0000019.499999109.5104.72107.858.400001
188.0000019.499999109.5104.72107.858.500001
188.0000019.499999109.5104.72107.858.600001
188.0000019.499999109.5104.72107.858.700001
188.0000019.499999109.5104.72107.858.800001
188.0000019.499999109.5104.72107.858.900001
188.0000019.499999109.5104.72107.859.000001
188.0000019.499999109.5104.72107.859.100001
188.0000019.499999109.5104.72107.859.200001
188.0000019.499999109.5104.72107.859.300001
188.0000019.499999109.5104.72107.859.400001
199.59.999999111.29105.5110.849.5
199.59.999999111.29105.5110.849.6
199.59.999999111.29105.5110.849.7
199.59.999999111.29105.5110.849.8
199.59.999999111.29105.5110.849.9
201010113.29108.88112.15null
1 ACCEPTED SOLUTION
v-yohua-msft
Community Support
Community Support

Hi, @CEllis 

 

Perhaps you can use the following M expression:

 

vyohuamsft_0-1706864498996.png

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("TVJBEsQgCPtLzzsMqAi+ZWf//42FYGs7YxFNQhS/30uuz8XE+eVUaKz8Yjob+aioM2Mn1uv3+V4NQH2R7LCMTCuKVAyVZPVC6mGtm2RMqLCo90odlCzfyhwo7UXpNLOONWqWcZB0kHI1VTq1scHO1NO0hRmtfCyAZwHBOUf3KOqJXzSk8lbiBmDB7ZHXmBdszMq7Ae4FLPzj3Z00Hfoglcr3zebu2GPx3p00oRq3U9cinJDTtHGkVziFlTjprFw2KZG6xxrUWmlaHmn1RzuX9WjrS1tJvYyhTZFLcTKbe6xJ5iUJgUD5huE1Hel5pIW5OhPsjgj/YKHLewgL8aj9bpu4qjWS1e3I21s+eowjeDYyF9r9LCVlfA9hzYsoAOOd86C5/QN1CqzzYIQXHkWirWh4aqChMLbXy5JIWcqSoArflhpj/flJv6FODncSbQ313x8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Group = _t, #"Start Range" = _t, #"Finish Range" = _t, #"Reading(PAG)" = _t, #"Writing(PAG)" = _t, #"Maths(PAG)" = _t]),
    #"Changed column type" = Table.TransformColumnTypes(Source, {{"Start Range", type number}, {"Finish Range", type number}}),
    List = Table.AddColumn(#"Changed column type", "Key Stage 1 Average PAG", each List.Numbers(Number.Round([Start Range],2)+0.01, Number.Round(([Finish Range]-[Start Range]),2)*100,0.01)),
    #"Expanded Key Stage 1 Average PAG" = Table.ExpandListColumn(List, "Key Stage 1 Average PAG")
in
    #"Expanded Key Stage 1 Average PAG"

 

Here is my preview:

 

vyohuamsft_1-1706864499003.png

 

 

 

How to Get Your Question Answered Quickly 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yohua-msft
Community Support
Community Support

Hi, @CEllis 

 

Perhaps you can use the following M expression:

 

vyohuamsft_0-1706864498996.png

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("TVJBEsQgCPtLzzsMqAi+ZWf//42FYGs7YxFNQhS/30uuz8XE+eVUaKz8Yjob+aioM2Mn1uv3+V4NQH2R7LCMTCuKVAyVZPVC6mGtm2RMqLCo90odlCzfyhwo7UXpNLOONWqWcZB0kHI1VTq1scHO1NO0hRmtfCyAZwHBOUf3KOqJXzSk8lbiBmDB7ZHXmBdszMq7Ae4FLPzj3Z00Hfoglcr3zebu2GPx3p00oRq3U9cinJDTtHGkVziFlTjprFw2KZG6xxrUWmlaHmn1RzuX9WjrS1tJvYyhTZFLcTKbe6xJ5iUJgUD5huE1Hel5pIW5OhPsjgj/YKHLewgL8aj9bpu4qjWS1e3I21s+eowjeDYyF9r9LCVlfA9hzYsoAOOd86C5/QN1CqzzYIQXHkWirWh4aqChMLbXy5JIWcqSoArflhpj/flJv6FODncSbQ313x8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Group = _t, #"Start Range" = _t, #"Finish Range" = _t, #"Reading(PAG)" = _t, #"Writing(PAG)" = _t, #"Maths(PAG)" = _t]),
    #"Changed column type" = Table.TransformColumnTypes(Source, {{"Start Range", type number}, {"Finish Range", type number}}),
    List = Table.AddColumn(#"Changed column type", "Key Stage 1 Average PAG", each List.Numbers(Number.Round([Start Range],2)+0.01, Number.Round(([Finish Range]-[Start Range]),2)*100,0.01)),
    #"Expanded Key Stage 1 Average PAG" = Table.ExpandListColumn(List, "Key Stage 1 Average PAG")
in
    #"Expanded Key Stage 1 Average PAG"

 

Here is my preview:

 

vyohuamsft_1-1706864499003.png

 

 

 

How to Get Your Question Answered Quickly 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yohua-msft 

 

Fantastic works brilliantly thank you very much.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.