Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I am attempting group my table of IncomingWork items by CustomerID as well as if they have been created within 72hours from the earliest entry. I have created the sample table with data below and how the items should be counted.
The end result should have CustomerID 1001 have a total of 2 items, and 2001 a total of 1 item.
I am not familiar enough with DAX functions to complete this, is anyone able to assist me?
Thank you in advance.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ndAxDsAgCEDRuzBrghhsO7bXMN7/Gg52qd/BdH0DfKhVbgliaimqx5SlhYlOkCnJt6iQOD5z/IrSRCXqoIcH/SAnlS06SBfofeGHWG/sWhFTjV2ZG1c0R4yvtg4=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [CustomerID = _t, Date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"CustomerID", type text}, {"Date", type date}}),
#"Grouped Rows" = Table.RemoveColumns(Table.Group(#"Changed Type", {"CustomerID"}, {{"ar", each Table.AddIndexColumn(Table.Group(_, "Date", {"All", each _}, 0, (x,y) => Number.From(Duration.Days(y-x)>=3)),"Index",1)}}), "CustomerID"),
#"Expanded ar" = Table.RemoveColumns(Table.ExpandTableColumn(#"Grouped Rows", "ar", {"Date", "All", "Index"}, {"Date", "All", "Index"}), "Date"),
#"Expanded All" = Table.ExpandTableColumn(#"Expanded ar", "All", {"CustomerID", "Date"}, {"CustomerID", "Date"})
in
#"Expanded All"
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Thank you for the quick reply. I apologize though, I meant to ask this for in a Measure format.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
38 | |
26 | |
20 | |
14 | |
8 |
User | Count |
---|---|
71 | |
47 | |
46 | |
20 | |
16 |