Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi!
I have a table that looks similar to this:
| Issue_Name | Module | Threshold_Critical | Threshold_Severe | Threshold_Normal |
| Number Change | 1 | 20.0% | 10.0% | NA |
| Number Change | 2 | 0.0% | NA | NA |
| Number Change | 3 | -5.0% | -10.0% | NA |
| Number Change | 4 | -20.0% | -15.0% | NA |
| Number Change | 5 | 0.0% | NA | NA |
| Number Change | 6 | 0.0% | NA | NA |
| Number Change | 7 | -65.0% | -70.0% | -75.0% |
| Number Change | 8 | -95.0% | -90.0% | -85.0% |
| Number Change | 9 | 0.0% | NA | NA |
| Number Change | 10 | 0.0% | NA | NA |
| Number Change | 11 | 0.0% | NA | NA |
| Number Change | 12 | 0.0% | NA | NA |
| Corrupted Record | 1 | 10 | 5 | 3 |
| Corrupted Record | 2 | 3 | 1 | NA |
| Corrupted Record | 3 | 3 | 1 | NA |
| Corrupted Record | 4 | 3 | 1 | NA |
| Corrupted Record | 5 | 3 | 1 | NA |
| Corrupted Record | 6 | 3 | 1 | NA |
When I connected the table to Power BI, the percentages are automatically transformed into decimals. I tried to recover the percentages by changing data type for the three columns, but the issue is that I don't want the thresholds for "Corrupted Record" to be transformed into percentages.
This is how the table looks like in Query Editor:
I am wondering if it is possible to change data type for a few rows or if there is any workarounds.
Thank you in advance!
Solved! Go to Solution.
Hi,
I suggest that you use this M code to transform your data as shown in the image below
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Replaced Value" = Table.ReplaceValue(Source,"NA",null,Replacer.ReplaceValue,{"Threshold_Critical", "Threshold_Severe", "Threshold_Normal"}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Replaced Value", {"Issue_Name", "Module"}, "Attribute", "Value"),
#"Pivoted Column" = Table.Pivot(#"Unpivoted Other Columns", List.Distinct(#"Unpivoted Other Columns"[Issue_Name]), "Issue_Name", "Value"),
#"Changed Type" = Table.TransformColumnTypes(#"Pivoted Column",{{"Number Change", Percentage.Type}, {"Corrupted Record", type number}})
in
#"Changed Type"
Hope this helps.
Hi,
I suggest that you use this M code to transform your data as shown in the image below
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Replaced Value" = Table.ReplaceValue(Source,"NA",null,Replacer.ReplaceValue,{"Threshold_Critical", "Threshold_Severe", "Threshold_Normal"}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Replaced Value", {"Issue_Name", "Module"}, "Attribute", "Value"),
#"Pivoted Column" = Table.Pivot(#"Unpivoted Other Columns", List.Distinct(#"Unpivoted Other Columns"[Issue_Name]), "Issue_Name", "Value"),
#"Changed Type" = Table.TransformColumnTypes(#"Pivoted Column",{{"Number Change", Percentage.Type}, {"Corrupted Record", type number}})
in
#"Changed Type"
Hope this helps.
Data types cover the entire column. Your only options are to set everything to text, or to leave it at variant (ABC123).
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 38 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 65 | |
| 30 | |
| 26 | |
| 25 |