Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Comparing values based on separate date slicers.

I am having an issue comparing a BASELINE value to each occurance of the TARGET values. I can get the "most recent baseline value" out of the range of dates I have selected. The problem is the TARGET values. I need to compare the BASELINE value to EACH TARGET instance. I have provided a link to a pbix file with sample data displaying the issue. Date slicers are set up top. Left table shows the correct BASELINE values, but the "Total Cost' column is summing the values. In the right table, the "Total Cost" is not summing as I added the "rn" column to separate each instance of the TARGET costs, but is diplaying BASELINE values based on each occurance of the TARGET values. What I need, is the ability to compare the "Most Recent Baseline Value" to each instance of the TARGET values (no sum). Any help on this would be greatly appreciated. This one is a bit out of my scope of knowlegde.

 

Thank you for any help that can be suggested.

 

https://www.dropbox.com/s/oq0gmxxkwphgnrg/Sample.pbix?dl=0

1 Reply

  • Hi , Anonymous 

    According to your .pbix file , do you mean you want to get the same "Total cost" in the right table?

    If this , you can try this dax :

    Total Cost = 
    CALCULATE( SUMX(VCS,VCS[VendorCost100_weightedavg]) , ALL('VCS'[rn]))

     

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

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