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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
thisanco
Frequent Visitor

dax measure on fabric notebook - fabric.evaluate_measure

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

df = fabric.evaluate_measure('Total', measure="Total")


is there any issue to make a measure  using fabric.evaluate_measure library when the model is dual ?
1 ACCEPTED 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.

  • To use the same logic in a notebook, please use an explicit DAX query for example SUMMARIZECOLUMNS via fabric.evaluate_dax, or keep the required dimensions in Import mode.

 

Thanks and regards,

Anjan Kumar Chippa

View solution in original post

6 REPLIES 6
Olufemi7
Solution Sage
Solution Sage

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

 

https://learn.microsoft.com/en-us/fabric/

Jihwan_Kim
Super User
Super User

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.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

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.

  • To use the same logic in a notebook, please use an explicit DAX query for example SUMMARIZECOLUMNS via fabric.evaluate_dax, or keep the required dimensions in Import mode.

 

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors