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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nirrobi
Helper V
Helper V

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.

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
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:

1.PNG

 

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.

2.PNG

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
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

3 REPLIES 3
v-yulgu-msft
Employee
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:

1.PNG

 

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.

2.PNG

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Dear Yuliana ,

thanks for your message.

 

When I follow your guidence I ended with this table :

 

image.png

I change the base table as follow:

image.png

 

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:

image.png

 

and the formula for the measure:

 

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

 

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

I reproduce from scratch and I works smoothly.

 

many thanks,

 

Nir

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.