Forum Discussion
"New column" greyed out in Semantic Model builder
- 1 year ago
Hello dolphinantonym,
Because the semantic model is based on a direct lake mode, the option is grayed (disabled).
But how do you do it ?
Option 1 : add the calculated column directly in the source (whether is excel or create view or other sources)
Option 2 : if you are storing data into a lakehouse, you can use notebooks with sparkSQL or pyspark or Dataflow gen2 (low code) to add calculated columns into the table in your lakehouse.
Option 3 : if you are storing data into a warehouse : add the column in your warehouse, change dataflow, change column mapping and rerun.
I found this video helpful for your need : https://www.youtube.com/watch?v=kFQ-dNBUUF4
Hope it can help you !
Best regards,
Antoine
- 1 year ago
Thank you for the reply.
I am storing data in a Lakehouse, but none of those options apply because I want my calculated column to handle unmatched cases in reports. The below shows the kind of thing I have in my Lakehouse - Table 1 is relationshipped to Table 2, but when building a report based primarily on Table 1 I want to calculate something that can show "No details available":
Table 1 Table 2 Report ID Table 2 ID ID Details Table 1 ID Details 1 a a A - details 1 A - details 2 b b B - details 2 B - details 3 c c C - details 3 C - details 4 4 No details available I could create the report as a table using Notebooks if I wanted to, but that would result in storing an unneccessary amount of data so I'm looking into ways to calculate this dynamically in the Semantic Model instead so that it is only calculated at the point of use.
Since the semantic model is using Direct Lake mode, some options—like adding calculated columns—are disabled (grayed out) in Power BI.
So how can you add calculated columns? Here are a few ways depending on where your data is stored:
Option 1: If your data is in Excel or another source
Add the calculated column directly in the source file or view. For example, update your Excel sheet or modify the SQL view to include the new column.
Option 2: If your data is in a Lakehouse
Use tools like:
- Notebooks (with SparkSQL or PySpark)
- Dataflow Gen2 (low-code option)
These let you add calculated columns directly into your Lakehouse tables.
Option 3: If your data is in a Warehouse
Add the column inside the warehouse table, then:
- Update your dataflow
- Adjust the column mapping
- Rerun the dataflow to reflect the changes
Let me know if you want help choosing the best method for your setup or writing the actual transformation logic.