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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
watje255_ju
Helper III
Helper III

Remove Date Filter Context within Measure , and lookup value from measure result?

Hello,

 

For each batch / test (from Test_Attributes Fact Table) I would like to also show the cost /kg ( from Procurement table). The batch numbers between the two tables are the same.

However, the latest test results are sometimes months after the product was purchased, therefore as the date relationships are based on the quite recent test date ( Test Attributes Fact Table) and the historic procurement (Procurement table) the slicer filters out the cost.

For example, the cost/kg shows up for batch 769-744-21 with no slicer, but disappers when changing the slicer after the procurement date, but includes the last test day. 

I tried to use ALL to take the filter context off the date, but its still not returning a cost, any reason why/how to pull the cost through regardless of the date slicer? 

 

watje255_ju_0-1676712769972.pngwatje255_ju_1-1676712793031.png

 

 

Also, is it possible to pull through cost/kg based off the voucher number? Some batches have the same voucher number, but no cost associated with the batch, I would like to pull through the cost/kg for that voucher and apply it against all batches with the same voucher number, is this possible? E.g in this example, all batches have voucher number PIV001, so I want to pull through the same cost for these guys, not just the two batches?

watje255_ju_2-1676712853856.png

 

Thanks for any help with A or B! PBIX file link Results_Test.pbix

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @watje255_ju 

Placing a variable inside CALCULATE won't work as variables are calculated only once. Just wrap the inner CALCULATE with the outer CALCULATE without using the variable COST

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @watje255_ju 

Placing a variable inside CALCULATE won't work as variables are calculated only once. Just wrap the inner CALCULATE with the outer CALCULATE without using the variable COST

Thanks!!

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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