Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All
My PBI File :-
https://www.dropbox.com/s/lqtacfyj7p09l4h/DYNAMIC%20MEASURE.pbix?dl=0
Solved! Go to Solution.
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
Proud to be a Super User!
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.
Regards,
Manikumar
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 ?
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.
Proud to be a Super User!
Hi Mani
Do you mean i need to manually enter below long stnyax ?
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
Proud to be a Super User!
didn't get what you are trying to say.
Could you please elobarate more.
Regards,
Manikumar
Proud to be a Super User!
Hi All
if you open the file
there is attribute field
I want to know how to create ?
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
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(........
As I mentioned before, check the Advanced Editor to look into the M query.
Regards,
Manikumar
Proud to be a Super User!
@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
Proud to be a 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.
User | Count |
---|---|
102 | |
91 | |
87 | |
79 | |
71 |
User | Count |
---|---|
113 | |
105 | |
101 | |
75 | |
64 |