Forum Discussion
SuryaDave
Helper I
1 year agoDynamic String Format
Hello experts, My question to relates to the dynamic string that are now available in Power BI. Btw I am using latest Power BI desktop and my original file is on our cloud server ( premium ) ...
- 1 year ago
Hi SuryaDave
Just to help further (and in case it’s helpful for anyone else referencing this thread), I’ve created a sample.pbixfile that demonstrates the SELECTEDVALUE pattern
Hope it helps!!
Ashish_Mathur
Super User
1 year agoHi,
While this is not a direct answer to your question, my suggestion would be to transform your data in a form that creates seperate columns for each metric. This M code does that
let
Source = Excel.Workbook(File.Contents("C:\Users\Ashish Mathur\Downloads\Dynamic String Question.xlsx"), null, true),
Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"State Level Metric", type text}, {"Month End Date", type date}, {"Numberator", Int64.Type}, {"Denominator", Int64.Type}, {"Value", type number}, {"Column6", type any}, {"Column7", type any}, {"Column8", type any}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Numberator", "Denominator", "Column6", "Column7", "Column8"}),
#"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[#"State Level Metric"]), "State Level Metric", "Value"),
#"Changed Type1" = Table.TransformColumnTypes(#"Pivoted Column",{{"State wide concern raised - Type A - %", Percentage.Type}})
in
#"Changed Type1"
Hope this helps.