This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I would like to transform my table as follow:
Can anyone her helps me to solve this problem? Thank you in advanced!
Do you actually need this as a physical table in your model? If you need to see it as a visual, all you need is to create a measure using COUNT for the discount field and create a matrix with the customers as rows, the discount field as columns and the measure as values. So...
Count Discount =
COUNT(fTable[Discount])
Proud to be a Super User!
Paul on Linkedin.
@Anonymous , You need to use pivot
https://radacad.com/pivot-and-unpivot-with-power-bi
example code
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUfJJLUvNUTBUitVB5huB+Ulo8knI8rEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Customer = _t, Discount = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Customer", type text}, {"Discount", type text}}),
#"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Discount", "Discount - Copy"),
#"Pivoted Column" = Table.Pivot(#"Duplicated Column", List.Distinct(#"Duplicated Column"[Discount]), "Discount", "Discount - Copy", List.Count)
in
#"Pivoted Column"
Hei,
The table in the right is showing the count number of Discout (level) each Customer has received.
Hi @Anonymous ,
1. Duplicate "discount"column
2. Pivot the "discount" column:
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 26 | |
| 23 | |
| 22 | |
| 13 |
| User | Count |
|---|---|
| 61 | |
| 47 | |
| 27 | |
| 23 | |
| 18 |