Forum Discussion
Shared semantic model vs local model - different results for same measure code
Hi all,
Hoping someone can please explain some very odd behaviour which seems to depend on whether or not a table is created in a local model, or by direct query.
I have the following tables:
ProjectTargets:
DimCalendar (truncated table shown) (this is created locally):
DimCalendarRemote:
This table is identical to DimCalendar, but created in a separate semantic model and published to PowerBi Service.
Measure:
I have a measure created which calculates the latest project update (based on MAX(ProjectTargets[DateKey])).
If I use the local copy of DimCalendar, with relationships setup as follows, this is what I get:
Note that the results above produce the expected output.
If I switch the relationship to use DimCalendarRemote, using the same measure, this is what I get:
Note that the results above differ based on where the DimCalendar is stored.
Hoping someone can please explain why the exact same measure produces different results when using a shared semantic model.
Kind regards,
Ben.
Hi bhalicki,
We regret the inconvenience caused and acknowledge your requirements. Please consider raising a Microsoft support ticket for further investigation. You can explain all the troubleshooting steps you have taken to help them better understand the issue.
You can create a Microsoft support ticket with the help of the link below:
https://learn.microsoft.com/en-us/power-bi/support/create-support-ticketIf this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
10 Replies
- v-ssriganesh
Community Support
Hi bhalicki,
Thank you for posting your query and providing detailed information. The difference in results between using a local model (DimCalendar) and a shared semantic model (DimCalendarRemote) with the same measure could be due to several factors:
- The relationship with DimCalendarRemote might handle filtering differently due to its shared semantic model nature, potentially affecting context propagation in Direct Query mode.
- DimCalendarRemote, if not fully refreshed or synchronized, might yield different results compared to the local DimCalendar or If DimCalendarRemote uses Direct Query while the local model is imported, differences in query execution or source database behavior could impact the MAX(DateKey) calculation.
- The SELECTEDVALUE(ProjectTargets[ProjectKey]) might behave differently based on the active relationship and context in the shared model.
Here are the few troubleshooting steps you can consider:
- Verify that the relationships between ProjectTargets and both DimCalendar tables are correctly set up and active.
- Test the measure with a simple MAX(ProjectTargets[DateKey]) to isolate the issue.
- Check the Power BI Service for any refresh delays or performance issues with DimCalendarRemote.
- Check the data types and values in DateKey and ProjectKey are consistent across both models.
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.- bhalicki
Helper V
Hi v-ssriganesh ,
Thank you for your reply, much appreciated.I have checked as per your suggestions and cannot find anything that would cause this issue. Data types are consistent. Using a simple measure MAX(ProjectTargets[DateKey]) yields the same results for both local and remote DimCalendar tables, but this is expected as it doesn't filter the row context by the Project Key.
Is there anything else I can try, or does this need to be escalated to Microsoft as a bug? Seems very strange behaviour.
Kind regards,Ben.
- v-ssriganesh
Community Support
Hi bhalicki,
Thank you for getting back and providing the additional details. It’s great that you’ve confirmed the data types are consistent and that a simple MAX(ProjectTargets[DateKey]) works as expected across both tables. Since the issue persists with the LatestProjectMonth measure (which includes filtering by ProjectKey), it does suggest a potential context or relationship evaluation difference between the local and remote models.
- Ensure the filter direction and cross-filtering settings between ProjectTargets and DimCalendarRemote are identical to those with DimCalendar. A mismatch here could affect the row context.
- Modify the measure to use ALLSELECTED(ProjectTargets) instead of ALL(ProjectTargets) to see if the selected context changes the outcome.
- Use Power BI’s Performance Analyzer to compare the query steps for both scenarios. This might reveal differences in how the shared semantic model processes the filter.
I trust this addresses your needs. If it does, please “Accept as solution” and give it a "kudos" to help others find it easily.
Thank you.
- v-ssriganesh
Community Support
Hi bhalicki,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.