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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
koorosh
Post Partisan
Post Partisan

pivot through DAX expression

Hello Experts,

Is it possible to change the following with DAX expressions instead of using power query ?

 

koorosh_0-1645553663337.png

 

3 REPLIES 3
v-yetao1-msft
Community Support
Community Support

Hi @koorosh 

Original data :

Ailsamsft_0-1645770656278.png

You can create a calculated table like this :

Table 2 = SUMMARIZECOLUMNS('Table'[ID],"A1", CALCULATE ( MAX ( 'Table'[Values] ), 'Table'[Attributes] = "A1" ),
                                       "A2", CALCULATE ( MAX ( 'Table'[Values] ), 'Table'[Attributes] = "A2" ),
                                       "A3", CALCULATE ( MAX ( 'Table'[Values] ), 'Table'[Attributes] = "A3" ))

Then add a table visual to display column [A1][ A2][ A3] .

Ailsamsft_1-1645770656279.png

I have attached my pbix file , you can refer to it .

 

Best Regard

Community Support Team _ Ailsa Tao

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

Hi Ailsa, 
Thanks, but how you did make ID in the Table? Especially when the data become large.

 

Best Regards

Koorrosh

 

tackytechtom
Super User
Super User

Hi @koorosh ,

 

It is not impossible to do pivoting in DAX, but very often there are better solutions depending on what you would like to achieve. Is this a particular visual you are after?

 

Here is an example / discussion about a similar issue that might give you some additional inspiration 🙂

Solved: Pivot or Transpose Table using DAX rather than Pow... - Microsoft Power BI Community

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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