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.
Hi,
I would like for the value in my Count column to change from a 1 to a 0.5 but only if the person's name in my Scheduled Person column is the same 2 days in a row (back to back days) from my Appt date column. Also the Procedure needs to be equal to A and the Center needs to be equal B.
Solved! Go to Solution.
Here is the code with the solution. The main part is the group-by with group-kind local as 4th argument (no in the UI). Good luck.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZcxLCsAgDIThu2QtTJKqrcs+LxG8/zVaQhVLYVYfw29GCTJBWZUCrVSDUYQsTTaXAslNdhcRPHvpcMrD6XThAu6lq9P8JWFw/FMaqN4=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Person = _t]),
#"Changed Type with Locale" = Table.TransformColumnTypes(Source, {{"Date", type date}}, "en-US"),
SortedRows = Table.Buffer(Table.Sort(#"Changed Type with Locale",{{"Date", Order.Ascending}})),
#"Grouped Rows" = Table.Group(SortedRows, {"Person"}, {{"Count local", each Table.RowCount(_), Int64.Type}, {"Data", each _, type table [Date=nullable date, Person=nullable text]}}, GroupKind.Local),
#"Removed Columns" = Table.RemoveColumns(#"Grouped Rows",{"Person"}),
#"Expanded Data" = Table.ExpandTableColumn(#"Removed Columns", "Data", {"Date", "Person"}, {"Date", "Person"}),
#"Added Custom" = Table.AddColumn(#"Expanded Data", "factor", each if [Count local] >= 2 then 0.5 else 1)
in
#"Added Custom"
Do you have a custom solution in DAX? I have to insert multiple arguments depending on the type of procedure and center location. Thank you.
The solution can be found here:
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 |
---|---|
46 | |
28 | |
22 | |
12 | |
8 |
User | Count |
---|---|
75 | |
52 | |
46 | |
15 | |
12 |