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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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]





Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

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))





Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.