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

View all the Fabric Data Days sessions on demand. View schedule

Reply
BIswajit_Das
Super User
Super User

Calculated Table

Hello Experts,
Need Guidance with the below structure

Table1 with data :

idpartyvalue
1B10845
2B22921
1I20921
5I5807
7I40044
9B24634
9I11967
14I869

 

The Required Result Table :

idBI
11084520921
222921 
5 5807
7 40044
92463411967
10  
14 869

Using Calculated table on Power BI desktop

Thanks & Regards....

2 ACCEPTED SOLUTIONS

I don't think it is possible to do a pivot operation dynamically in dax; only in power query. At least I can not think of any way to achieve this.

View solution in original post

Anonymous
Not applicable

Hi @BIswajit_Das 

 

sjoerdvn is right.

DAX has a number of limitations, and if this is a calculated table, this is the only way to do it

vzhengdxumsft_0-1724136717212.png

Or you can try to export the data from the calculated table and import it again to use power query. But it's going to be very complicated.

 

Best Regards

Zhengdong Xu
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

7 REPLIES 7
sjoerdvn
Super User
Super User

Table2 = ADDCOLUMNS(VALUES(Table1[id])
    ,"B", CALCULATE(VALUES(Table1[value]),ALLEXCEPT(Table1,Table1[id]), Table1[party]="B")
    ,"I", CALCULATE(VALUES(Table1[value]),ALLEXCEPT(Table1,Table1[id]), Table1[party]="I")
)

Hello @sjoerdvn 
Thanks for responding
Yeah we can do it this way
But we  have mention column names each time
Isn't there any other way to acheive this?

Anonymous
Not applicable

Hi @BIswajit_Das 

 

sjoerdvn is right.

DAX has a number of limitations, and if this is a calculated table, this is the only way to do it

vzhengdxumsft_0-1724136717212.png

Or you can try to export the data from the calculated table and import it again to use power query. But it's going to be very complicated.

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I don't think it is possible to do a pivot operation dynamically in dax; only in power query. At least I can not think of any way to achieve this.

BIswajit_Das
Super User
Super User

Hello @Anonymous, @Idrissshatila 

Thanks for responses but as I mentioned above my table is a calculated table which is not gonna show in transform data section
That's why I wonder if there's another way to do so..
Thanks & Regards...

Anonymous
Not applicable

Hi @BIswajit_Das 

 

 

Please try this:

Click the Transform data in the Home pane:

vzhengdxumsft_0-1723443952299.png

Copy the origin table and paste it:

vzhengdxumsft_1-1723444002487.png      vzhengdxumsft_2-1723444034923.png

Select the party column and click the Pivot Column:

vzhengdxumsft_3-1723444128850.png

vzhengdxumsft_4-1723444180471.png

The result is as follow:

vzhengdxumsft_5-1723444201528.png

Finally, Close & Apply.

 

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Idrissshatila
Super User
Super User

Hello @BIswajit_Das ,

 

you can acheive the below in Power Query with pivot.

 

check it out https://youtu.be/Sm_NodeFvPg?si=cKZpyEYOpOR2FXnH

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors