Forum Discussion

nirrobi's avatar
nirrobi
Icon for Helper V rankHelper V
9 years ago
Solved

What If Analysis - Data Table - similar to exel function

Hi all,

I want to implement in PBI the same function as in excel .

I have 2 variables that effect measure and what to see in one table how the change of those 2 variables effect the calculation of the measure.

 

in excel its located in the following path:

data ribbon

what if

data table

 

for example multiplication table.

 

C4 - X

B4 - Y

 

in the first line of the table in the left - C4 * B4

 

 

the function excel create automatic:

{=TABLE(C4,B4)}

 

output

 

112345678910
112345678910
22468101214161820
336912151821242730
4481216202428323640
55101520253035404550
66121824303642485460
77142128354249566370
88162432404856647280
99182736455463728190
10102030405060708090100

 

Is it possible to implement it in excel?

 

thanks in advanced.

Nir.

  • Hi nirrobi,

     

    It is not possible to generate such an data table automatically in Power BI desktop.

     

    But we can achieve a similar output via below workaround. It would be better that the dataset imported into Power BI looks like:

     

    Based on this basic table, you should create a calculated table using this formula:

    Sheet2 = CROSSJOIN(SELECTCOLUMNS(Sheet1,"X",Sheet1[X]),SELECTCOLUMNS(Sheet1,"Y",Sheet1[Y]))

    Create a measure that returns multiplication values.

    multiplication = MAX(Sheet2[X])*MAX(Sheet2[Y])

    In report view, insert a Matrix visual to display data.

     

    Best regards,
    Yuliana Gu

3 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi nirrobi,

     

    It is not possible to generate such an data table automatically in Power BI desktop.

     

    But we can achieve a similar output via below workaround. It would be better that the dataset imported into Power BI looks like:

     

    Based on this basic table, you should create a calculated table using this formula:

    Sheet2 = CROSSJOIN(SELECTCOLUMNS(Sheet1,"X",Sheet1[X]),SELECTCOLUMNS(Sheet1,"Y",Sheet1[Y]))

    Create a measure that returns multiplication values.

    multiplication = MAX(Sheet2[X])*MAX(Sheet2[Y])

    In report view, insert a Matrix visual to display data.

     

    Best regards,
    Yuliana Gu

    • nirrobi's avatar
      nirrobi
      Icon for Helper V rankHelper V

      Dear Yuliana ,

      thanks for your message.

       

      When I follow your guidence I ended with this table :

       

      I change the base table as follow:

       

      I use your formula for the new table:

       

      Sheet2 =
      CROSSJOIN(
          SELECTCOLUMNS( Sheet1, "X" , Sheet1[X]),
          SELECTCOLUMNS( Sheet1 ,"Y" , Sheet1[Y] ))

       

      and got this table - 100 rows:

       

      and the formula for the measure:

       

      multiplication = MAX( Sheet2[X] ) * MAX( Sheet1[Y] )

       

      can you please check if you see any reason for that?

      • nirrobi's avatar
        nirrobi
        Icon for Helper V rankHelper V

        I reproduce from scratch and I works smoothly.

         

        many thanks,

         

        Nir