Forum Discussion

Bastien_O's avatar
Bastien_O
Frequent Visitor
7 years ago
Solved

Calculated column with filter on a measure

Hello,

I have created two measures who's called "DatePlusAncienneApprouvee" and "AnneePlusAncienneApprouvee", the first returns me the first "[Date d'émission]" with 3 filters. And the second returns the 1st January of the year from the first measure "DatePlusAncienneApprouvee".

Capture4.PNG

 


Capture5.PNG

They works !


Capture6.PNG

 

 

 

 

 

 

 

 

 

 

After I want create a new calculated column, who return at each rows "OK" if "[Date d'émission]" is after the date of "AnneePlusAncienneApprouvee" (so the 01/01/2016) and if "[Date d'émission]" is before it return "KO" in the row.

 


Capture7.PNG

 

And the first problem is that calculated column uses all filters of "DatePlusAncienneApprouvee" and when the row doesn't fill the filters it's return 01/01/1900. And the second problem is even the row fill all filters it will return the 1st January of his year (if [Date d'émission] the the 12 July 2017 it will return the 01/01/2017 while he should return the 01/01/2016).Capture3 (2)_LI.jpg

You can view the first problem at the 1 of the picture and the second at the 2.

Thanks in advance for your assistance.

  • Hello everyone, 

     

    I have just found the solution of my problem !

     

    Before I have created a measure to find the first date who complete my filters.

    I take it and I create a new table who returns all the date between the 1st January of the year of my first date and today. 

    I have created a relation between the new column and the date of all data.

     

    And after I edit my calculated column.

    And finally, my calculated column works perfectly.

     

4 Replies

  • v-danhe-msft's avatar
    v-danhe-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Bastien_O ,

    Could you please offer your pbix file to have a test if possible, you could upload it in OneDrive and send the link here.

    Also you could try to use a calculated measure instead of calculated column.

     

    Regards,

    Daniel He

    • Bastien_O's avatar
      Bastien_O
      Frequent Visitor

      Hello, 

      I'm sorry I can't send you the link that's private data.

      What type of measure ?

      Regards

    • Bastien_O's avatar
      Bastien_O
      Frequent Visitor

      Hi v-danhe-msft 

      I can do an array for illustrate and if it help you !

       

      Hope I help you ! 

      Regards, 

      Bastien

      • Bastien_O's avatar
        Bastien_O
        Frequent Visitor

        Hello everyone, 

         

        I have just found the solution of my problem !

         

        Before I have created a measure to find the first date who complete my filters.

        I take it and I create a new table who returns all the date between the 1st January of the year of my first date and today. 

        I have created a relation between the new column and the date of all data.

         

        And after I edit my calculated column.

        And finally, my calculated column works perfectly.