I have a table which stores details of machines and I want to produce a service schedule counting the number of machines scheduled for a service in 30, 60, 90, 120+ bands.
I have created a measure which does not work properly. The example below is for those machines requiring a service between 31 to 60 days.
Service 60 Days =
COUNTX(Fans,
IF(Fans[First Service Date] - TODAY() > 30 && Fans[First Service Date] - TODAY() <= 60, 1, 0))
Hi @PaulBoyes. To help the forum members visualize your issue and target, please provide your work-in-progress PBIX file (with sanitized or sample data, if necessary) along with a marked-up screenshot of the visual you’re trying to achieve or an Excel mock-up of your desired outcome.
Greg
Hi @PaulBoyes. A few things right off the bat. Your model does not have a DATES table; please add one and mark it as such to enable you to use the DAX time intelligence functions in your model.
The M code for an excellent DATES table is available from Enterprise DNA:
Then, a data modelling refactor and/or a review of your data is necessary. (I noticed, for example, that there are very few records which are actually linked between your [Fans] table and your [Transform-ITData] tables.)
Once the DATES table has been added, marked as such, your model and/or data has been reviewed and revised as necessary, repost if you’re still having issues with your measures.
Hi @PaulBoyes. Progress with the DATES table, but the modelling and data review effort is still needed from your side. The DATES table as well is not modelled to your data (and the main field needs to be “Date”, not “Date/Time”), and the data issues remain. Please review the data that will be used for linking and adjust as necessary.
Greg