Forum Discussion

AC23VM's avatar
AC23VM
Icon for Helper II rankHelper II
1 year ago

Values over past 3 months - string type converting to numerical

This should be a quick one, but I can't get Copilot to play ball.  I want to look at the top 5 sets of values over the past 3 months.  When I apply these filters, say to a column chart with the date as the X axis, it shows me 3 separate months.  I want to combine them, to show 5 columns as one set of 'over the past 3 months', rather than 15 columns (5 for Oct, 5 for Nov, 5 for Dec).  Copilot suggested this measure, where the sum doesn't work 'cos it's trying to count string type data:

CALCULATE(
    SUM('Testing Data'[Sub Root Cause]),
    DATESINPERIOD(
        'Testing Data'[Date Completed].[Date],
        MAX('Testing Data'[Date Completed].[Date]),
        -3,
        MONTH
    )
)

 

I'm guessing an easy fix would be a custom column like a countrows, but if anyone has a better idea - or if anyone can help me figure out the syntax for that custom column, I'd be grateful.

3 Replies

  • AC23VM

    Circulare reference may suggest that you have a poorly designed data model.

     

    The question is bit vague.

    Please dont post Copilot buggy DAX and expect us to fathom what you want.

    Please do provide example input data (as a table and not a screen print so we can import it and build a solution).

    Please do provide example idesired output.

    Step by description.

    Dataset schema diagarms.

    Hide any private data.

    Try use meaningful column names, and use the same column names in the input, output and description.

    Thank you

     

     

    • AC23VM's avatar
      AC23VM
      Icon for Helper II rankHelper II

      Hahaha.  What a rudely worded response.  Maybe that wasn't your intention, but intensely off-putting for someone inexperienced with these systems.