March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a daily data interval table and need assistance with MCode, a measure or custom column to assign "On Site" or "Off Site" based on criteria....where total Work time = total Other time for the entire day, assign "Off Site" else "On Site" and have the assignment for the day assigned to each interval for the individual.
Solved! Go to Solution.
Hello, did it in a lot of steps, hope it helps.
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}}),
#"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"Date", "Full Name", "Store", "Work", "Other"}),
#"Grouped Rows" = Table.Group(#"Removed Other Columns", {"Date", "Full Name", "Store"}, {{"Sum Work", each List.Sum([Work]), type number}, {"Sum Other", each List.Sum([Other]), type number}}),
#"Added Conditional Column" = Table.AddColumn(#"Grouped Rows", "Location", each if [Sum Work] = [Sum Other] then "Off Site" else "On Site"),
Custom1 = Table.NestedJoin(#"Changed Type",{"Date", "Full Name", "Store"},#"Added Conditional Column",{"Date", "Full Name", "Store"},"Custom"),
#"Expanded Custom" = Table.ExpandTableColumn(Custom1, "Custom", {"Location"}, {"Location"})
in
#"Expanded Custom"
Work, thank you! Had to adjust as the store could be 1 - 3 stores, so I removed "Store" as and where applicable. Thanks Again!
Hello, did it in a lot of steps, hope it helps.
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}}),
#"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"Date", "Full Name", "Store", "Work", "Other"}),
#"Grouped Rows" = Table.Group(#"Removed Other Columns", {"Date", "Full Name", "Store"}, {{"Sum Work", each List.Sum([Work]), type number}, {"Sum Other", each List.Sum([Other]), type number}}),
#"Added Conditional Column" = Table.AddColumn(#"Grouped Rows", "Location", each if [Sum Work] = [Sum Other] then "Off Site" else "On Site"),
Custom1 = Table.NestedJoin(#"Changed Type",{"Date", "Full Name", "Store"},#"Added Conditional Column",{"Date", "Full Name", "Store"},"Custom"),
#"Expanded Custom" = Table.ExpandTableColumn(Custom1, "Custom", {"Location"}, {"Location"})
in
#"Expanded Custom"
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.