Forum Discussion

oren's avatar
oren
Helper III
5 years ago
Solved

comparing same data for 2 different dates

Hi

i have table with prices and dates and i want to compare 2 prices from 2 different dates,

ffor that i created another same table with same data

for each table i used a diffrent date filter.

now i wants to compare the 2 different prices in another table

for this i created a measure in one of the tables -

 

---------------

DiffCountryPrice =
VAR thisyear =
SUM ( 'Sales By Country'[SaleAvgPrice] )
VAR lastyear =

SUM ( 'Sales by country 2'[SaleAvgPrice] )
RETURN if(or(ISBLANK(thisyear ) ,ISBLANK(lastyear )),BLANK(),
thisyear/lastyear-1)
 
---------
and then i used it in a new matrix
 
for some reason , it's not working.
i know this could work because i did it in different place.
i think it might be related to the filter sets or maybe i need to change something else..
 
 

 

 

thank you!

5 Replies

    • oren's avatar
      oren
      Helper III

      thank you

      i read your blog - it did helped me to find how to compare data for 2 diffrent dates which is what is need.

      the problem is that i also need to see the actual data (see the 2 matrix in the picture i sent), and if i use your method , than i cannot use the dates filters to see the actual data since i need to remove the connection between the date tables and the main data table (as you said in your blog - "Please note that we have not performed any join here with the Sales table. All three tables are independent tables.")

      again , the main issue is to see metrix data for each dates (2 dates) and next to it, the diffrences.

      i hope i was clear enoght .

       

      thank you again.

       

      • oren's avatar
        oren
        Helper III

        i also tried this solution :

         

        but it didn't worked well (it is working only if i put the same dates, if not it five me te data of the first tabe)

         

        in the red i put the "measuer 3" , did not working  😞