Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi - newby here.
I want to add a column in a table from 2 fields: Account and sub account.
The account is 123
Sub account is 45
My standard GL format is "000000-0000"
I'm looking for the correct formula. The way I think it (that obviously doesn't work) is:
#"KeyGL" = Table.AddColumn(DBIFGV_Table, "KeyGLBase", each FORMAT([DBGV_ACCOUNT],"000000") & FORMAT([DBGV_SUB_ACCOUNT],"0000"))
The result I'm looking for would be 00123-0045
Thanks!
Solved! Go to Solution.
= Table.AddColumn(Source, "Custom", each Text.PadStart([Column1], 6, "0") & "-" & Text.PadStart([Column2], 4,"0"))
Make sure that the two fields are text before this line. I think there's a slight mismatch between your format ( is "000000-0000") and the result you gave (00123-0045)
= Table.AddColumn(Source, "Custom", each Text.PadStart([Column1], 6, "0") & "-" & Text.PadStart([Column2], 4,"0"))
Make sure that the two fields are text before this line. I think there's a slight mismatch between your format ( is "000000-0000") and the result you gave (00123-0045)
Wow thanks so much!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
55 | |
55 | |
36 | |
30 |
User | Count |
---|---|
79 | |
66 | |
45 | |
44 | |
42 |