Forum Discussion
Adding alias to table column names
- 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
I see, it seems that the issue may be related to the presence of a column in the DAX query that's causing the error. If you are encountering issues with a specific column, you might want to check how that column is being used in your DAX measures and if it is causing any conflicts.
Here are a few suggestions to troubleshoot and resolve the issue:
Check for Ambiguities:
- Ensure that there are no ambiguous references in your DAX measures. For example, if there are multiple tables with the same column name, Power BI might have difficulty resolving which column to use.
Qualify Column Names:
- Fully qualify the column names in your DAX measures to avoid any ambiguity. For example:
Rate01_Alias = SUM('YourTableName'[Rate01])
Check Dependencies:
- Examine other measures or calculated columns that might be using the problematic column. Ensure that there are no circular dependencies or conflicting references.
Review Advanced Editor:
- If you are comfortable with the Power Query M language, you can review the Advanced Editor and inspect the query code. Look for any references to the problematic column and ensure they are correct.
If the issue persists, it might be helpful to see more of your DAX code or understand the specific steps where the error is occurring. If you can provide more details or share the relevant part of your DAX code, I'll do my best to assist you further.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
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
I think since Per_sBadgeNo is a column and not a measure thats where is a problem.
- 123abc2 years agoCommunity Champion
Please share sample data file.