Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How to load table data by Max date by default and will changes accordingly by user's date selection

Hi,

amitchandak Greg_Deckler ImkeF parry2k

I have a table with load date and the requirement is to load data by max load date when it will load for the first time, but there is also a Filter drop down with load date and when the user will select another date , the table will load with that date.

TO achieve this I have used below measure :

Measure 2 =
var vMaxLoadDate = CALCULATE ( MAX ( EDG_COUNT_STATUS[Date] ), ALL ( 'EDG_COUNT_STATUS' ) )
return
IF(MIN(EDG_COUNT_STATUS[Date]) = vMaxLoadDate,1,0)

and set it as filter in visual filter level and set the value to it as 1. But it always load data with latest date, but when I am going to select another date from filter dropdown it does not chnage the dates in the table.

But my requirement is to load table with selected date as well as by Max load by default.

How can i achive this? Below is the screen shot for reference:

 

So by default it is loaded with 03/15/2020 which is max load date, but when ever I am going to select another date from filter values, it does load with that date.

 

 

 

 

 

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi,

    I have solved it by below measure:


    Load Date =
    var vMaxLoadDate = IF(ISFILTERED(EDG_COUNT_STATUS[Date]),SELECTEDVALUE(EDG_COUNT_STATUS[Date]), CALCULATE ( MAX ( EDG_COUNT_STATUS[Date] ), ALL ( 'EDG_COUNT_STATUS' ) ))
    //var vMaxLoadDate = CALCULATE ( MAX ( EDG_COUNT_STATUS[Date] ), ALL ( 'EDG_COUNT_STATUS' ) ))
    //IF( MIN(EDG_COUNT_STATUS[Date]) = vMaxLoadDate ,1,0)
    return vMaxLoadDate

     

    and use 'Load Date' as measure column in the table , but you need to uncheck the 'Totals', as 'Load Date' is a measure, and it will show selected date in totals.

    but you can't select more than one Date value from Date filter dropdown.

     

    and it works well for me.

     

     

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      what is measure here?

      Measure 2 =
      var vMaxLoadDate = CALCULATE ( MAX ( EDG_COUNT_STATUS[Date] ), ALL ( 'EDG_COUNT_STATUS' ) )
      return
      if(isfiltered('Data'[Date]),
      calculate([measure],filter(EDG_COUNT_STATUS,EDG_COUNT_STATUS[Date]=vMaxLoadDate)),
      calculate([measure])
      )

      I dont understand. Please explain your thout about it.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi,

        Can any one suggest that how can we achieve this thing: How to load table data by Max date by default and will changes accordingly by user's date select

         

        please give me an idea about it.