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
crlucho
New Member

Value of a measure changing inside a New Table Query

Hi,

 

I´m trying to call the value from a measure inside a new table query. The value of the measure is a selected value from a slider. I am calculating the measure with the following formula: 

 

crlucho_0-1643231952431.png

 

I can print this measure inside a data card, for example: 

 

crlucho_1-1643232076569.png

 

But when i call the value inside the New table query, it is not retreving the same value. I call the measure in the following way:

 

crlucho_2-1643232139252.png

 

In this case, the table created will be always filtered by TODAY() Year, instead of the selected year in the slicer. Which (because of the m_year_selected formula) means the measure is not detecting the t_calendar_dates table as if it was filtered. For example selecting year 2019, and still the query be applying just for 2022.

 

crlucho_3-1643232226723.png

 

Rather if I just hardcode the year value inside the measure formula, the filter woul do work in the new table query.

 

crlucho_4-1643232417686.png

in this case the table is filtered as expected by the year value 2021:

 

crlucho_5-1643232468585.png

 

So in synthesis, the selected value from the t_calendar_dates is not being identified in the new table query and the table is not perceived by the query as of it being filtered. And i confirmed this fact because if the ISFILTERED() conditional is removed from the m_year_selected measure, the value retrieved would be "2016". Which corresponds to the minimum value found in the t_calendar_dates tables when no filter is applied.

 

Please help!

Are there multiple contexts? Or why is it that the table is not being detected as filtered by the selected value when pulled from the  new table query? Any ideas on a different approach on how to pass the selected year to the query?

 

 

1 REPLY 1
hnguy71
Memorable Member
Memorable Member

Hi @crlucho ,

 

Once a table is calculated, it will not recalculate based on your user's current selection. The only way for the table to recalculate is if it's forced to. Two examples are metadata changes and data model refresh.

 

An alternative solution is to create a virtual table and return the required results / output based on your critera.



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

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.