Forum Discussion

bolarinwa's avatar
bolarinwa
Frequent Visitor
5 years ago

Calculated Column- Active Months in Use

Hi, I created a calculated column Mont h in use which calculates the number of Months from the service data for each location e.g column 1 is the first service Month and column 6 is 6 Months after. However, I want each next Month to be Months when the service is active, that is only when there are values. For example in row 1 values in months 14-19 should be in columns 6-12.

Below is my dax code 

Months in Use (Location) = FLOOR(DATEDIFF(RELATED(categories[First Feedback]), RELATED('Time'[Start Of Day]), DAY) / (365/12), 1) + 1
 
Please help.

 

 

 

 

 

2 Replies

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi bolarinwa ,

     

    The FLOOR function cannot be used in the calculated column and row level security in the direct connection mode. The RELATED function takes effect only if there is a relationship between the current table and the target table. The function follows the existing many-to-one relationship. Please check the connection method of the data source. First, eliminate the errors caused by the above function restrictions. If there are still problems, can you provide a test data model (delete sensitive information) and the expected results, I will answer you as soon as possible.


    Let me know the result immediately, looking forward to your reply.

     

    Best Regards,
    Henry

     

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