cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
akhaliq7
Helper V
Helper V

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
Helper V
Helper V

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
Helper V
Helper V

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

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors