Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
I have a revenue table that shows the total contract value, the start month, and the number of months (Term__c). I have been able to repeat the rows for the number of months, but I need to add a new column showing the number of months incrementing from 1 to Number of months. Here's what my data looks like:
I'd like to get to this, with MonthNumber being the new column. I'd like to keep the original Term__c column to see the total months.
I'm using this, but I'm not sure how to reference the Term__c in the List.Numbers to generate 1 to N.
Table.TransformColumns(#"Filtered Rows", {"Term__c", each List.Numbers(1,_,0), type list})
I've tried this but it errors out:
Table.TransformColumns(#"Filtered Rows", {"Term__c", each List.Numbers(1,"Term__c",0), type list})
And this:
Table.TransformColumns(#"Filtered Rows", {"Term__c", each List.Numbers(1,[Term__c],0), type list})
Any suggestions?
Thank you in advance.
Solved! Go to Solution.
I figured it out myself. I added a custom colum that copied the Term__c so that I had the original total months, then modified the TransformColumns step to this. The key was to drop the 3rd increment argument and use underscore as the second argument. TIL that underscore is a reference to the loop field when using each this way.
Table.TransformColumns(#"Filtered Rows", {"Term__c", each List.Numbers(1,_), type list})
I figured it out myself. I added a custom colum that copied the Term__c so that I had the original total months, then modified the TransformColumns step to this. The key was to drop the 3rd increment argument and use underscore as the second argument. TIL that underscore is a reference to the loop field when using each this way.
Table.TransformColumns(#"Filtered Rows", {"Term__c", each List.Numbers(1,_), type list})
I'm not sure how the item listed in the solution actually gets you to the repeated rows. For me it just makes a column with a list type. This is what worked for me.
= Table.ExpandListColumn(Table.AddColumn(#"Filtered Rows", "MonthNumber", each List.Numbers(1,[Term__c])),"MonthNumber")
Ideal, thanks Tony
Hi @Anonymous , can I ask how you managed to repeat the rows by the number of months please, i'm really stuck on this one?
Thank you
watch this video, it was really helpful for me: https://www.youtube.com/watch?v=6NAQf9b5J14
User | Count |
---|---|
117 | |
74 | |
62 | |
50 | |
45 |
User | Count |
---|---|
174 | |
125 | |
60 | |
60 | |
57 |