Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Independent Column Values for Pivot Table

Hi All,   I have an excel file that has 108 code columns like A6A** and A6K**.  I would like to count rows for every single values in excel. However, when I do it with Power BI Pivot Table, it auto...
  • bolfri's avatar
    bolfri
    3 years ago

    Ok. Then... In Power Query M:

    let
        Źródło = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Xc6xCoYwDATgd+nsYlrdU3pm+KekhQzF938NSxX5cQg33MeR3gNc2zyuTjGtYQm8/5hn8shz6UHh5jCyWmQYelC+UcaNxBQmQFO0FLf1o/JUUqoMIJEobjgQ04eVZ+zw0bqaOuhFf2+dFw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Long VIN" = _t, A6K = _t, A6A = _t]),
        #"Unpivot Other Columns" = Table.UnpivotOtherColumns(Źródło, {"Long VIN"}, "Family", "Value")
    in
        #"Unpivot Other Columns"

     

    Create New Measure:

    Count of VIN = DISTINCTCOUNT('Sample'[Long VIN])