Forum Discussion

BIswajit_Das's avatar
BIswajit_Das
Icon for Impactful Individual rankImpactful Individual
2 years ago
Solved

POWER BI CALCULATED TABLE

Hello,

I've got a demo data :

i.e

SLNOPRODUCTTYPE
1AX1
1BX2
1CX3
1DX1
1EX4
1RX2
1FX1
1GX2
1IX1
2JX1
2KX1
2MX1
2LX2
2NX2
2OX2

and 

my required calculated column is like

SLNOX1X2X3X4TOTAL
143119
233006

Thanks & Regards...

  • Anonymous's avatar
    Anonymous
    2 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

  • 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.

  • Anonymous's avatar
    Anonymous
    Not 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's avatar
    BIswajit_Das
    Icon for Impactful Individual rankImpactful Individual

    Hello Anonymous is it possible without using matrix

    Creating a caculated column instead

    • Anonymous's avatar
      Anonymous
      Not 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.