Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mohittimpus
Helper V
Helper V

How to create Calculate column in Direct Query Mode

I need to create Calculate Column in Direct Query Mode. How to create Calculate Column in Direct Query Mode? 
I am sharing a Demo File in Below link:

 

https://drive.google.com/open?id=10-EuA6iNQi3fYoLuIqYBeWawIwHhoNTm

 

 

1 ACCEPTED SOLUTION

 
As mentioned before, you can also learn more about the limitations of directquery:
You can also create a measure instead of a calculated column.
 
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

 
First of all, you need to know the implications of using directquery.
https://docs.microsoft.com/en-us/power-bi/desktop-directquery-about#modeling-limitations
 
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rajulshah
Super User
Super User

Hello @mohittimpus ,

 

You can create calculated column by going to Modelling>New Column.

Please let me know if this didn't help.

I can make the calculate column but when I try to make the calculate colaumn like this it not not give me correctr result.

 


No Injury / Injury = IF ('''SHC Fall Data$'''[Outcomes] = "Fall1-None"
|| '''SHC Fall Data$'''[Outcomes] = "Fall1-None Fall1-None"
|| '''SHC Fall Data$'''[Outcomes] = "Fall1-None No Injor",
"No Injury", IF('''SHC Fall Data$'''[Outcomes] = "Fall2-Mild/Minor" || '''SHC Fall Data$'''[Outcomes] = "Fall2-Mild/Minor Fall2-Mild/Minor"
|| '''SHC Fall Data$'''[Outcomes] = "Fall2-Mild/Minor Fall2-Mild/Minor Fall2-Mild/Minor"
|| '''SHC Fall Data$'''[Outcomes] = "Fall2-Mild/Minor *** Fall2-Mild/Minor"
|| '''SHC Fall Data$'''[Outcomes] = "Fall3-Moderate"
|| '''SHC Fall Data$'''[Outcomes] = "Fall4-Major"
|| '''SHC Fall Data$'''[Outcomes] = "Fall5-Death","Injury"
))

 

In above Dax that hard code value is not reconsigned in Direct query and new column is not give result "injuery" or "Non injuery".

 

Same code is working prefectly in import format. 

 
As mentioned before, you can also learn more about the limitations of directquery:
You can also create a measure instead of a calculated column.
 
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.