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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
akhaliq7
Continued Contributor
Continued Contributor

calculated column with 1 in each row

I have 1 table where I need to add 1 to each row of a column which will be a unit count column such as the following

 

column 1      unit count

aaa                    1

abc                    1

abb                   1

acb                   1

acc                    1

etc...

1 ACCEPTED SOLUTION
akhaliq7
Continued Contributor
Continued Contributor

Answered my own question. really simple to do. create calculated column type: Unit Count = 1

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

It is for creating a new column.

 

Picture1.png

 

Unit Count CC =
VAR currentitem = Data[Column1]
RETURN
    COUNTROWS ( FILTER ( Data, Data[Column1] = currentitem ) )

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


akhaliq7
Continued Contributor
Continued Contributor

Answered my own question. really simple to do. create calculated column type: Unit Count = 1

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors