Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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:
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |