Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello Friends,
Can you help me with the below calculation,
I want to create a new column "B" based on existing column "A".
| A | B |
| Desktop | 4 |
| Desktop | 4 |
| Desktop | 4 |
| Desktop | 4 |
| Laptop | 2 |
| Laptop | 2 |
| IPAD | 3 |
| IPAD | 3 |
| IPAD | 3 |
Solved! Go to Solution.
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]))
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.
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]))
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.
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:
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?.
| A | Country | B |
| Desktop | US | 3 |
| Desktop | US | 3 |
| Desktop | US | 3 |
| Desktop | UK | 1 |
| Laptop | US | 1 |
| Laptop | UK | 1 |
| IPAD | UK | 2 |
| IPAD | UK | 2 |
| IPAD | US | 1 |
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 46 | |
| 43 | |
| 39 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 65 | |
| 31 | |
| 28 | |
| 24 |