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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
amsrivas
Helper IV
Helper IV

To add Identity column in PowerShell result

Hi Guys!!

 

I have executed below command and data has been captured.

 

$Workspaces = Get-PowerBIWorkspace

$Workspaces

 

Output is shown as below 

 

Id : 5eyh4u7e-11e1-4c53-95f9-938fhf7d5af
Name : WorkSpace-1
IsReadOnly : False
IsOrphaned : False
IsOnDedicatedCapacity : True
CapacityId : 97jsuh6u-87hy-4k78-CF45B-C34ff354r41D

 

Id : b3j756b5-r745-3t56-q234-frbrf481a84f7
Name : Workspace-2
IsReadOnly : False
IsOrphaned : False
IsOnDedicatedCapacity : True
CapacityId : 97jsuh6u-87hy-4k78-CF45B-C34ff354r41D

 

I want to add one more column of Identity, sat ColA =1 etc as shown as below

 

ColA =1

Id : 5eyh4u7e-11e1-4c53-95f9-938fhf7d5af
Name : WorkSpace-1
IsReadOnly : False
IsOrphaned : False
IsOnDedicatedCapacity : True
CapacityId : 97jsuh6u-87hy-4k78-CF45B-C34ff354r41D

 

ColA =2

Id : b3j756b5-r745-3t56-q234-frbrf481a84f7
Name : Workspace-2
IsReadOnly : False
IsOrphaned : False
IsOnDedicatedCapacity : True
CapacityId : 97jsuh6u-87hy-4k78-CF45B-C34ff354r41D

 

Please suggest how to achieve this.

 

Thanks

Amit Srivastava

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @amsrivas,

As lbendlin said, your results already exists on unique field values. If you want a common readable index column, you can rank these unique values based on characters.  

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @amsrivas,

As lbendlin said, your results already exists on unique field values. If you want a common readable index column, you can rank these unique values based on characters.  

Regards,

Xiaoxin Sheng

lbendlin
Super User
Super User

You already have a unique ID attribute.  What's the rationale for adding another ?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.