Forum Discussion
Justas4478
2 years agoPost Prodigy
Adding alias to table column names
Morning, I am using table in power bi and referencing it as so I wouldnt need to create multiple query request. There is 'Rates' columns form 1-20 and I am grouping them together to have number of h...
- 2 years ago
Hi Justas4478,
I think I figured out what might be going on.
When you shared the sample data, it looks like this...
I wonder if it was just Excel that added that date portion?
If that's the case I'll need to edit the code. It would be good to have a sample file with the correct formats.
------
I've done some checks and I think you should just be able to delete that one step.
Try this code.
let Source = Table1, Unpivot = Table.UnpivotOtherColumns(Source, {"Per_sBadgeNo", "AttDate"}, "Attribute", "Value"), CT1 = Table.TransformColumnTypes( Unpivot, { {"Per_sBadgeNo", Int64.Type}, {"AttDate", type date}, {"Attribute", type text}, {"Value", type duration} } ), GR1 = Table.Group( CT1, {"Per_sBadgeNo", "AttDate"}, {{"Duration", each List.Sum([Value]), type nullable duration}} ), AddTotalMinutes = Table.AddColumn( GR1, "Total Minutes", each Duration.TotalMinutes([Duration]), type number ), AddTotalHours = Table.AddColumn( AddTotalMinutes, "Total Hours", each Duration.TotalHours([Duration]), type number ) in AddTotalHours
Justas4478
2 years agoPost Prodigy
123abc There doesnt seem to be any problem with Rate01_Alias = SUM('YourTableName'[Rate01]) measures that I created.
The DayTotal looks like is acceptim them without any problems. What is problem for
DayTotal measure is: Per_sBadgeNo column that is like personal ID number of a employee.
I think since Per_sBadgeNo is a column and not a measure thats where is a problem.
I think since Per_sBadgeNo is a column and not a measure thats where is a problem.
123abc
2 years agoCommunity Champion
Please share sample data file.