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
talsed
Frequent Visitor

Live connection to Dataset and calculated measure/column (?) based on one of the fields

Hi,

 

I am new to PBI so maybe I'm missing something here, but it should be quite simple  problem (hopefully :)). 

 

So I have a dataset which I am connected live to and I need to create a measure/column (?) based on one of the columns in the dataset.

For example: 

I have a column with "Country" value. 

I need to create a dynamic measure/column (?) to be based on that "Country" field with the following conditions:

IF ( Country = USA) then "USA" else "ROW"

 

So then in the report I will be able to use this new dynamic calculated measure/column (?) instead of original "Country" field. 

 

I understand that due to live connection, I have no ability to create a new column in the model (correct?). 

On the other hand, when I try to create a meassure, I am getting the error saying somwething like "you are asking to check multiple rows and not specific one, so the meassure cannot be created". 

 

It sounds like a simple task but I'm really stuck here and can't find any solution to it.

 

I have read in the forums about X-functions to produce row by row meassures but I don't find If X meassure. 

 

What am I missing? 

Thanks, 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @talsed ,

 

When you use Live connection, you can not add columns or table, it can only create a report level measure. If you need to add columns, you need to do these in the datasource.

 

When connecting to SQL Server Analysis Services (SSAS), there is an option to either import data from, or connect live to, the selected data model. If you select import, then you define a query against that external SSAS source, and the data is imported as normal. If you select to connect live then there is no query defined, and the entire external model is shown in the field list. If you select DirectQuery, as visuals are built, queries are sent to the external SSAS source. However, unlike DirectQuery, there is no sense in which a new model is being created; in other words, it's not possible to define new calculated columns, hierarchies, relationships, and so on. Instead you are simply connecting directly to the external SSAS model.

Reference:https://docs.microsoft.com/en-us/power-bi/desktop-directquery-about

 

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi  @talsed ,

 

When you use Live connection, you can not add columns or table, it can only create a report level measure. If you need to add columns, you need to do these in the datasource.

 

When connecting to SQL Server Analysis Services (SSAS), there is an option to either import data from, or connect live to, the selected data model. If you select import, then you define a query against that external SSAS source, and the data is imported as normal. If you select to connect live then there is no query defined, and the entire external model is shown in the field list. If you select DirectQuery, as visuals are built, queries are sent to the external SSAS source. However, unlike DirectQuery, there is no sense in which a new model is being created; in other words, it's not possible to define new calculated columns, hierarchies, relationships, and so on. Instead you are simply connecting directly to the external SSAS model.

Reference:https://docs.microsoft.com/en-us/power-bi/desktop-directquery-about

 

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Anonymous
Not applicable

Hi, I have exactly the same problem!

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.