Forum Discussion
POWER BI CALCULATED TABLE
Hello,
I've got a demo data :
i.e
| SLNO | PRODUCT | TYPE |
| 1 | A | X1 |
| 1 | B | X2 |
| 1 | C | X3 |
| 1 | D | X1 |
| 1 | E | X4 |
| 1 | R | X2 |
| 1 | F | X1 |
| 1 | G | X2 |
| 1 | I | X1 |
| 2 | J | X1 |
| 2 | K | X1 |
| 2 | M | X1 |
| 2 | L | X2 |
| 2 | N | X2 |
| 2 | O | X2 |
and
my required calculated column is like
| SLNO | X1 | X2 | X3 | X4 | TOTAL |
| 1 | 4 | 3 | 1 | 1 | 9 |
| 2 | 3 | 3 | 0 | 0 | 6 |
Thanks & Regards...
- Anonymous2 years ago
Hi, BIswajit_Das
Based on the further requirements you have provided me, it seems that you are trying to achieve the effect you need not by matrix but by calculate column.
You can create a calculated column to calculate the number of rows of type "X1" in the first column.
X1 =
COUNTROWS(FILTER('Table', 'Table'[SLNO] = 1 && 'Table'[TYPE] = "X1"))
This method is available in the final Visualizations to get the final results you need.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- ThxAlot
Super User
You can't dynamically add columns to a calculated table (ie X1/X2/X3 ...); thus use pivot table viz or transform it in PQ by unpivoting TYPE column.
- AnonymousNot applicable
Hi, BIswajit_Das
Based on the information you have provided, Here are my answers to your questions.
1. Create a table according to your requirements.
2. Create a Matrix with SLNO as Rows and TYPE as Columns.
3. Create a Measure and migrate it to Values.
Measure =
COUNTROWS('Table (2)')
4. Then you can get the results you need
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- BIswajit_Das
Impactful Individual
Hello Anonymous is it possible without using matrix
Creating a caculated column instead
- AnonymousNot applicable
Hi, BIswajit_Das
Based on the further requirements you have provided me, it seems that you are trying to achieve the effect you need not by matrix but by calculate column.
You can create a calculated column to calculate the number of rows of type "X1" in the first column.
X1 =
COUNTROWS(FILTER('Table', 'Table'[SLNO] = 1 && 'Table'[TYPE] = "X1"))
This method is available in the final Visualizations to get the final results you need.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.