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
Anonymous
Not applicable

Dynamically recalculate a column when filters and slicers applied

Hello,

 

I have a table that contains data on product, sales amount and date when a certain product has been purchased in such amount. Also filters are applied to this table: date slicer and product filter.

 

I need to calculate a column that will have an average value of all sales for a selected product and ONLY for the dates range that has been specified with a date slicer. So basically, the calculated column should contain the same value  for every row(sales average for a chosen product and time period - specified by date slicer)  

 

I am trying to calculate this column by using CALCULATE function

inside this function I am using function AVERAGE(Table[sales])

as another arguments to the CALCULATE function I am passing function ALLEXCEPT function where I specify columns for which filters are appled: product and dates.

 

Looks like I am doing something completely wrong as  the calculated value in that column is static and is not being re-calculated every time i apply date slicer

 

Please advice 

 

Thank you

1 REPLY 1
sturlaws
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

you are not doing anything wrong. Calculated columns are only refreshed when the entire table/data model is refreshed. Which means calculated columns don't get refreshed or updated when a user uses slicers in a report.

 

If you need dynamic behaviour, you have to create measures.

Cheers,
Sturla

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.

Top Solution Authors