Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
I have the three coluns in my report mentioned below:
Is there a way that I can tranform them so that the end result can look like a column1 : ForecastedGrossRevenue Jan'2013, column 2: ForecastedGrossRevenue Feb'2013 and so on.
I want the data to be shown horizontally.
Regards,
Himanshu
Solved! Go to Solution.
Hi, @Anonymous
Sorry, I just missed one step before creating the custom column, you should first go to change the type of the column [EXPECTINMONTH] to “Text”:
Then you can add the custom column and check if it can work, you should also make sure the column name is same as yours in the expression.
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
According to your description, I can roughly understand your requirement, I think you can achieve this in the Power Query editor, you can try my steps:
This is my M code in the advanced editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwNNa10DVU0gEyTQyMgbSZoZ6RoVKsDlTSEixpaGluYgqkTS11jEwQkoYG2LTGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [EXPECTINMONTH = _t, FORECASTEDUSAGE = _t, ForecastedGrossRevenue.1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"EXPECTINMONTH", type date}, {"FORECASTEDUSAGE", Int64.Type}, {"ForecastedGrossRevenue.1", type number}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"ForecastedGrossRevenue.1", "ForecastedGrossRevenue"}}),
#"Changed Type1" = Table.TransformColumnTypes(#"Renamed Columns",{{"EXPECTINMONTH", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each "ForecastedGrossRevenue "&[EXPECTINMONTH]),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"EXPECTINMONTH", "FORECASTEDUSAGE"}),
#"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[Custom]), "Custom", "ForecastedGrossRevenue", List.Sum)
in
#"Pivoted Column"
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I'm getting an error while creating the custom column.
Hi, @Anonymous
Sorry, I just missed one step before creating the custom column, you should first go to change the type of the column [EXPECTINMONTH] to “Text”:
Then you can add the custom column and check if it can work, you should also make sure the column name is same as yours in the expression.
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , One Option, is unpivot the last two columns
https://radacad.com/pivot-and-unpivot-with-power-bi
Second is in matrix use "Show on row", But that will give , Feb 2021, Revene
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
95 | |
80 | |
77 | |
66 |
User | Count |
---|---|
129 | |
106 | |
106 | |
86 | |
72 |