Forum Discussion
Calculating Average Time based on a Status
- 7 years ago
So in PowerBI there are 2 locations to create custom calculated columns:
- Through Query Editor using PowerQuery (M) language
- Though the main window using DAX language. This is similiar to excel.
I gave you the DAX version because it's easier to read/understand/manipulate IMO. With DAX, you don't need to reload your data everytime there is logic changed on a caluclated column. Instead, DAX uses your existing loaded dataset, and processes the logic. This makes is much more agile than SQL or PowerQuery. However, I still write native SQL queries to pull my data, and even build calculated columns in SQL. I tend to avoid PowerQuery if possible, though it has it's benefits like parsing JSON.
Going Forward:
- Delete that step in PowerQuery
- Load your data
- From the Home Tab, Add a Calculated Column
- Paste my formula
- View the data on the Data view on the left side of the main Pbi window
Add Field
Thank you for the info, when I plugged in this formula to a custom column, I am recieving errors. Could you give me any pointers on what im doing wrong here? (see screenshots below)
Appreciate the help.
Formula entered into custom column
error received
So in PowerBI there are 2 locations to create custom calculated columns:
- Through Query Editor using PowerQuery (M) language
- Though the main window using DAX language. This is similiar to excel.
I gave you the DAX version because it's easier to read/understand/manipulate IMO. With DAX, you don't need to reload your data everytime there is logic changed on a caluclated column. Instead, DAX uses your existing loaded dataset, and processes the logic. This makes is much more agile than SQL or PowerQuery. However, I still write native SQL queries to pull my data, and even build calculated columns in SQL. I tend to avoid PowerQuery if possible, though it has it's benefits like parsing JSON.
Going Forward:
- Delete that step in PowerQuery
- Load your data
- From the Home Tab, Add a Calculated Column
- Paste my formula
- View the data on the Data view on the left side of the main Pbi window
Add Field
- KarlConstruct7 years agoFrequent Visitor
Thanks for the explaination, this helps a lot!