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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Pivot on dynamic dataset

I have a dataset as below 

 

ColumnAColumnB
XO1
YO1
ZZ2
AA3
BA3
CA3

 

It is highly possible, that the value changes as below 

ColumnAColumnB
XO1
YO1
ZO1
AV1
BV1
CV1

 

The value for Z has been updated as O1, instead of Z2. 

 

My requirement is to @PivotTable this table using Column B 

Column AO1V1Total
A 11
B 11
C 11
X1 1
Y1 1
Z1 1

 

The values for column B against column A is dynamic. The pivot breaks the refresh of the datamodel. How this can be resolved.  

1 ACCEPTED SOLUTION

Hi @Anonymous ,

According to your sample, if you select ColumnB and click Pivot Column like below:

vkalyjmsft_0-1642750276591.png

You will get this table, not your expected outcome.

vkalyjmsft_1-1642750352405.png

You can write a measure.

 

Count = COUNT('Table'[ColumnA])

 

Use a matrix like below, put ColumnA in Rows, ColumnB in Columns and the measure Count in Values. Get the expected output.

vkalyjmsft_2-1642750595927.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

 

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
Anonymous
Not applicable

Hi @amitchandak , 

I need to pivot the table, as i need to the data model structure as below, which would be used in further calculations and computations.

Row LabelsO1V1Grand Total
A 11
B 11
C 11
X1 1
Y1 1
Z1 1

 

There are several other columns like O1, V1. I have mentioned only 2 columns to illustrate the problem statement.

Note: I am not using the data table in the visualization directly. 

 

Thanks, 

Sangram

Hi @Anonymous ,

According to your sample, if you select ColumnB and click Pivot Column like below:

vkalyjmsft_0-1642750276591.png

You will get this table, not your expected outcome.

vkalyjmsft_1-1642750352405.png

You can write a measure.

 

Count = COUNT('Table'[ColumnA])

 

Use a matrix like below, put ColumnA in Rows, ColumnB in Columns and the measure Count in Values. Get the expected output.

vkalyjmsft_2-1642750595927.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

 

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

amitchandak
Super User
Super User

@Anonymous , In martix, You can have ColumnA on row and ColumnB on Column and count of ColumnB as values

 

or

Unpivot

https://radacad.com/pivot-and-unpivot-with-power-bi

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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