Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
First time trying to convert DAX to Power M Query and having a hard time getting started/finding exactly what I need in the help documents. Can someone help me convert this? And are there any resources/cheat sheets to help do this? For example "Calculate" in DAX is "X" in Power M, etc.
This is my DAX which gives me the count of Type's per Id.
Solved! Go to Solution.
Hi @TeresaBusby
You can use group by in power query to count rows, you can refer to the folloing link.
Group rows of data (Power Query) - Microsoft Support
You can put the following code to advanced editor in power query to as a sample
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUUpUitVBZyXBWclglhFc1gguawSRjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Type = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Type", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"ID", "Type"}, {{"Count", each Table.RowCount(_), Int64.Type}})
in
#"Grouped Rows"
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @TeresaBusby
You can use group by in power query to count rows, you can refer to the folloing link.
Group rows of data (Power Query) - Microsoft Support
You can put the following code to advanced editor in power query to as a sample
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUUpUitVBZyXBWclglhFc1gguawSRjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Type = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Type", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"ID", "Type"}, {{"Count", each Table.RowCount(_), Int64.Type}})
in
#"Grouped Rows"
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @TeresaBusby
I'm not sure why you need to traslate a DAX to Power M Query. Anyway, in the official doc, you can find every formula for M language (https://learn.microsoft.com/en-us/powerquery-m/power-query-m-function-reference).
In the case of your formula, you may need a grouping function (https://radacad.com/grouping-in-power-query-getting-the-last-item-in-each-group)
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 6 | |
| 5 |