Forum Discussion

FC_USER's avatar
FC_USER
New Member
3 years ago
Solved

Cannot convert value '' of type Text to type Integer.

I want to create a waterfall chart based on two selected years.

When comparing the results of 2019 and 2020, I want to sum the number of data before 2019 and add the data added in 2020.

I want to get all the data before 2019, but when I enter the function below, an error "Cannot convert value '' of type Text to type Integer." is displayed. Why is this?

 

wtf_test = CALCULATE(COUNTROWS(yozai),FILTER(yozai,yozai[last_action_date] < dateTable[selectedYears]))

 

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

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

 

  • FC_USER ,
    selectedyear = DATE(CONVERT(MID(CONCATENATEX(VALUES(DateTable[Column]),[Column],""),5,8),INTEGER),1,1)

    FC_USER If this post helps, please consider accept as solution to help other members find it more quickly and Appreciate your Kudos.

4 Replies

  • FC_USER ,
    selectedyear = DATE(CONVERT(MID(CONCATENATEX(VALUES(DateTable[Column]),[Column],""),5,8),INTEGER),1,1)

    FC_USER If this post helps, please consider accept as solution to help other members find it more quickly and Appreciate your Kudos.

    • FC_USER's avatar
      FC_USER
      New Member

      Mahesh0016 

      Thanks.But The result did not

      Do you know how to keep later years from multiple selected years in slicer as values for comparison?

       

      wtf_前年度繰越 = 
      CALCULATE(COUNTROWS(yozai),FILTER(yozai,yozai[last_action_date] < dateTable[selectedyear]))

       

       

       

       

      • Mahesh0016's avatar
        Mahesh0016
        Icon for Super User rankSuper User

        FC_USER 

        Please Try this one , if you compare multiple Year Selected 

        wtf_前年度繰越 = 
        CALCULATE(COUNTROWS(yozai),FILTER(yozai,yozai[last_action_date] IN {dateTable[selectedyear]}))