Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I've migrated a semantic model import to a dual mode, now my facts tables are in direct query mode while my dimension are in dual mode. previously in import semantic model I had a measure in my notebook to do a double check with my database source,
df = fabric.evaluate_measure(
dataset="database_dual",
measure="Total",
groupby_columns=[
"calendar[year]",
"calendar[month]",
"store[id]"
],
filters={
"calendar[year]": [2026, 2025, 2024]
}
)
now in semantic model dual mode, this haven't work anymore. It just worked when I query total measure , this measure access the total sale in a fact table
Solved! Go to Solution.
Hi @thisanco,
Thank you for reaching out to Microsoft Fabric Community.
Thank you @Jihwan_Kim for the prompt response.
This is expected behavior with composite models. After switching the model to composite, the relationships between fact and dimension tables become limited. fabric.evaluate_measure runs through the dataset engine and cannot group or filter across limited relationships
The measure works in power bi visuals because visuals use a different query execution path that can dynamically switch dual tables to import. Notebooks do not use that path.
Thanks and regards,
Anjan Kumar Chippa
Hello @thisanco,
Yes this behavior is expected when you migrate a semantic model from import to dual mode.
• In import mode, all data is cached in memory, so `fabric.evaluate_measure` can freely apply `groupby_columns` and `filters`.
In dual mode, fact tables are queried live using DirectQuery. Grouping and filtering parameters passed through the Python API are not always supported because they must be translated into SQL at the source. As a result, only direct measure evaluation works reliably, e.g.:
df = fabric.evaluate_measure(
dataset="database_dual",
measure="Total"
)
If you need grouping or filtering (such as by `calendar[year]`, `calendar[month]`, `store[id]`), the recommended approach is to define that logic inside the semantic model itself using DAX measures or calculated tables, and then call those measures from your notebook. For example:
TotalByPeriod =
CALCULATE(
[Total],
VALUES(calendar[year]),
VALUES(calendar[month]),
VALUES(store[id])
)
Then in Python:
df = fabric.evaluate_measure(
dataset="database_dual",
measure="TotalByPeriod"
)
Key takeaway:
There is no issue with the `fabric.evaluate_measure` library itself — the limitation comes from DirectQuery translation in dual mode. To replicate your import‑mode behavior, move grouping and filtering logic into DAX inside the semantic model, then call those measures from Python.
Microsoft Documentation:
https://learn.microsoft.com/en-us/fabric/data-science/read-write-power-bi-python
Hi,
I am not sure how your measure is written the semantic model, but for the first step, before we check the notebook, I think we can try to check if the measures are still working in the power bi report and semantic model. The reason for this is because of the changes to the limited relationship, and some DAX functions does not work as expected when comparing the same DAX measure under strong relationship vs. limited relationship.
Composite model guidance in Power BI Desktop - Power BI | Microsoft Learn
Thank you.
Yes, the measure is working on dashboard, my idea is to use the same measure on notebook .
Hi @thisanco,
Thank you for reaching out to Microsoft Fabric Community.
Thank you @Jihwan_Kim for the prompt response.
This is expected behavior with composite models. After switching the model to composite, the relationships between fact and dimension tables become limited. fabric.evaluate_measure runs through the dataset engine and cannot group or filter across limited relationships
The measure works in power bi visuals because visuals use a different query execution path that can dynamically switch dual tables to import. Notebooks do not use that path.
Thanks and regards,
Anjan Kumar Chippa
Hi @thisanco,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution I have provided for the issue worked? or let us know if you need any further assistance.
Thanks and regards,
Anjan Kumar Chippa
Hi @thisanco,
We wanted to kindly follow up to check if the solution I have provided for the issue worked? or let us know if you need any further assistance.
Thanks and regards,
Anjan Kumar Chippa
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |