Forum Discussion

mwolfc's avatar
mwolfc
Frequent Visitor
2 years ago
Solved

Convert a DAX measure

Hello, well, after 4 hours of research and Chat GPT, it's time to ask my Forum friends!  

Question:  I have a DAX measure which I'm using in a card visual, which gives a count of records, and it works great.  

<CountWalksInPreviousWeek =
CALCULATE(
    COUNTROWS('Booked Sales'),
    FILTER(
        'Booked Sales',
        'Booked Sales'[QW Date] >= (TODAY() - WEEKDAY(TODAY(), 2) - 6) && 'Booked Sales'[QW Date] <= (TODAY() - WEEKDAY(TODAY(), 2))
    )
)>
It counts the number of rows containing QW Dates occuring over the previous Mon-Sun period.  
Now, for a drill-own visual I want to modify this measure into a new measure that will list out these filtered dates, and also list 2 other fields with values from those rows.  The new field names are "Job Name" and "Customer".  Everything I have tried today has failed me.  Thanks so much!
  • Hi mwolfc you already have rows, if your measure works as expected πŸ™‚

    In your measure, filter part will give your "rows"

    Put this into calculated table and you will have it.

     

    FILTER(
    'Booked Sales',
    'Booked Sales'[QW Date] >= (TODAY() - WEEKDAY(TODAY(), 2) - 6) && 'Booked Sales'[QW Date] <= (TODAY() - WEEKDAY(TODAY(), 2))
    )

     

    Did I answer your question? Kudos appreciated / accept solution!

2 Replies

  • some_bih's avatar
    some_bih
    Community Champion

    Hi mwolfc you already have rows, if your measure works as expected πŸ™‚

    In your measure, filter part will give your "rows"

    Put this into calculated table and you will have it.

     

    FILTER(
    'Booked Sales',
    'Booked Sales'[QW Date] >= (TODAY() - WEEKDAY(TODAY(), 2) - 6) && 'Booked Sales'[QW Date] <= (TODAY() - WEEKDAY(TODAY(), 2))
    )

     

    Did I answer your question? Kudos appreciated / accept solution!

    • mwolfc's avatar
      mwolfc
      Frequent Visitor

      Thank you so much for the suggestion!  I simply dragged that measure into the drill-down report and it worked perfectly!