The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I would like to create a column that counts the number of items in a comma separated striong as follows:
However, the ProjectCount column is currently returning errors (and needs an IF statement added if the project string has no commas the count should be 1).
This then splits the cost based on how many projects for each row. I shall then be splitting/pivoting the table on the projects.
Any help much appreciated.
Solved! Go to Solution.
Hi @BenGWeeks ,
Try using this calculation instead:
if [Projects] = null then 0 else List.Count(List.PositionOf(Text.ToList([Projects]), ",", Occurrence.All)) + 1
Pete
Proud to be a Datanaut!
Hi @BenGWeeks ,
Try using this calculation instead:
if [Projects] = null then 0 else List.Count(List.PositionOf(Text.ToList([Projects]), ",", Occurrence.All)) + 1
Pete
Proud to be a Datanaut!
@BenGWeeks , This power query code used in DAX new column. Please open data transformation and try it there.
User | Count |
---|---|
65 | |
60 | |
55 | |
54 | |
31 |
User | Count |
---|---|
180 | |
88 | |
70 | |
46 | |
46 |