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
Paulyeo11
Impactful Individual
Impactful Individual

How to view the Dynamic measure script ?

1 ACCEPTED SOLUTION

@Paulyeo11 ,

 

Need not to do that. You can do this way and also unpivot the columns with the Power BI tranform options. 

 

You have to select Amount and Cost columns on the table then in Transform tab use Unpivot columns. You will get the final result.

 

regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




View solution in original post

13 REPLIES 13
manikumar34
Solution Sage
Solution Sage

@Paulyeo11 , 

 

I can see this is a Unpivoted data. 

 

If you wanna look into it click on transform Data and the you can see the list steps applied on the table else you can also look into M query with Advance Editor. 

 

manikumar34_0-1602571844700.png

 

Regards, 

Manikumar

 





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Hi Mani

i try to open power quary , i notice that i am unable to view the script for attribute. below is the screen shot from my note book , pls let me know where i go wrong ?

Paulyeo11_0-1602582916378.png

 

@Paulyeo11 , 

 

The last step which Unpivoted columns is having the attrbute. 

When we do Upivot the value will be changed from Columns to Rows. The column Names will become Attributes and the Row values will become Values. 

 

Click Advance Editor to check the M query for all the steps done on the query. 

 

Regards, 

Manikumar

 

If you think this is helpful, Please Accept as a Solution and leave a like. 





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Hi Mani

Do you mean i need to manually enter below long stnyax ? 

Paulyeo11_0-1602583681585.png

 

@Paulyeo11 ,

 

Need not to do that. You can do this way and also unpivot the columns with the Power BI tranform options. 

 

You have to select Amount and Cost columns on the table then in Transform tab use Unpivot columns. You will get the final result.

 

regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




manikumar34
Solution Sage
Solution Sage

@Paulyeo11 , 

didn't get what you are trying to say. 

 

Could you please elobarate more.

 

Regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Hi All

if you open the file 

there is attribute field 

I want to know how to create ?

@Paulyeo11 

 

This is the script. 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WciwoyEnVCcjIzMksKMjMS9UxNNCxUIrViVZyzk/Ozyst0QnJSMzMScxL0TE007FUio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Fruit,Country,Amount,Cost" = _t]),
#"Split Column by Delimiter" = Table.SplitColumn(Source, "Fruit,Country,Amount,Cost", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Fruit,Country,Amount,Cost.1", "Fruit,Country,Amount,Cost.2", "Fruit,Country,Amount,Cost.3", "Fruit,Country,Amount,Cost.4"}),
#"Renamed Columns" = Table.RenameColumns(#"Split Column by Delimiter",{{"Fruit,Country,Amount,Cost.1", "Fruit"}, {"Fruit,Country,Amount,Cost.2", "Country"}, {"Fruit,Country,Amount,Cost.3", "Amount"}, {"Fruit,Country,Amount,Cost.4", "Cost"}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Renamed Columns", {"Fruit", "Country"}, "Attribute", "Value")
in
#"Unpivoted Columns"

 

 

If ypu check the below line, the data is unpivoted. Amount and cost columns are Unpivoted. Attributes are which the Column headers and Values are the Column values. 

#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Renamed Columns", {"Fruit", "Country"}, "Attribute", "Value")

Regards,

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Hi Mani

 

you have share with me below script , may i know where you found it ? it is from the same screen shot you share at power quiry ?

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText(........

 

 

@Paulyeo11 , 

 

As I mentioned before, check the Advanced Editor to look into the M query. 

 

Regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Anonymous
Not applicable

@Paulyeo11 - Attribute is not something which is created. It is the content of the table.

 

Appreciate your kudos!! Mark this post as solution if this helps.

@Paulyeo11 , It is unpivoted table, 

 

You can refre to the Screenshot I shared on the last reply

 

Regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




amitchandak
Super User
Super User

@Paulyeo11 ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

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.