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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.