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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Gopinath_iyer
Helper II
Helper II

Calculated column

Hello Friends,

 

Can you help me with the below calculation, 

I want to create a new column "B" based on existing column "A".

 

AB
Desktop4
Desktop4
Desktop4
Desktop4
Laptop2
Laptop2
IPAD3
IPAD3
IPAD3
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Gopinath_iyer ,

 

It seems that you want to calculate the row count of each A and each Country, right?

Please try:

B = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[A],'Table'[Country]))

Eyelyn9_0-1649988984892.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Gopinath_iyer ,

 

It seems that you want to calculate the row count of each A and each Country, right?

Please try:

B = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[A],'Table'[Country]))

Eyelyn9_0-1649988984892.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

vojtechsima
Super User
Super User

Hi, @Gopinath_iyer 
Can you be more precise about what exactly you want?
Do you want just a duplicate of the A column? 
You can do that by just referencing the column in Calculated Column like this:

B = 'Table'[A]

I want to create column B with count of attributes in column A respectively.

E.g Column A has 4 rows with "Desktop" so column B should 4 and 

Column A has 2 rows for "Laptop" so B should be 2 and so on.

@Gopinath_iyer 
I see, makes sense.
Here you go:

vojtechsima_0-1649759750450.png

New B = 
var currentGrouop = 'Table'[A]
return COUNTROWS(FILTER('Table', 'Table'[A] = currentGrouop))

Thanks a lot its working...but it missed the country filter...can you suggest?.

 

ACountryB
DesktopUS3
DesktopUS3
DesktopUS3
DesktopUK1
LaptopUS1
LaptopUK1
IPADUK2
IPADUK2
IPADUS1

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors