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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Date doesn't filter

I have one measure that filters the data correctly by date: 

Plant_Daily_AVG = CALCULATE(AVERAGE('Raw Data'[VALUE]),'Raw Data'[ORIGIN_CODE]="R",'Date'[Date])
(I linked the raw data [date] (which has results for the same day therefore there are mulitple dates) with the Date Calendar I made which has one date.)
I get results per day when I use the slicer. 
 I then want to list it in an if statement so I can pull by IPN number.
Result =  IF(Report2[IPN]=RELATED('Treatment Plant'[IPN]),CALCULATE('Treatment Plant'[Plant_Daily_AVG]),0)
I lose the date slicer ability and i just takes the average of all data.
How do I get the date back?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Since your result column is a calculated column, calculated columns can't dynamically change values, so he won't change based on slicer changes. You can create a measure instead.

Result = 
var _a=LOOKUPVALUE('Treatment Plant'[IPN],Report2[id],MAX('Treatment Plant'[id]))
return IF(MAX('Report2'[IPN])=_a,[Plant_Daily_AVG],0)

vtangjiemsft_0-1689908286882.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

 

Since your result column is a calculated column, calculated columns can't dynamically change values, so he won't change based on slicer changes. You can create a measure instead.

Result = 
var _a=LOOKUPVALUE('Treatment Plant'[IPN],Report2[id],MAX('Treatment Plant'[id]))
return IF(MAX('Report2'[IPN])=_a,[Plant_Daily_AVG],0)

vtangjiemsft_0-1689908286882.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors