Forum Discussion

Nimai123's avatar
Nimai123
Post Patron
6 years ago
Solved

DAX-Calculating Relative sum problem

I have a measure which is working fine named as

 

Booked Early = 

var qr = SELECTEDVALUE(QTR[Qtr Name])
var wn = SELECTEDVALUE(Qtr[Week Num])
return
CALCULATE(Sum(bookings_reporting_view[line_item_acv_price_converted]),
bookings_reporting_view[cld_fq] = qr,
bookings_reporting_view[cld_weekhelp] = wn,
bookings_reporting_view[timing_quarter] = {"a - early"},
bookings_reporting_view[stage] in {"Booked","5 - Renewal Won"}
)
 
And I want to calculate the creative sum of the data.
The measure created by me works well for some dates not for all.
Running Booked Early = CALCULATE(SUM(bookings_reporting_view[line_item_acv_price_converted]),
FILTER (
ALLSELECTED(bookings_reporting_view),
bookings_reporting_view[cld_fq] <= MIN(Qtr[Qtr Name])
&& bookings_reporting_view[cld_weekhelp] <= MIN(Qtr[Week Num])
&& bookings_reporting_view[timing_quarter] = {"a - early"}
&& bookings_reporting_view[stage] in {"Booked","5 - Renewal Won"}
)
)
 
While it's working well when selected FY19-Q1 in the slicer - if there is data it adds up with the previous data and if no data it displays the same data as shown bellow
17 18 19 are the week numbers in that quarter 
 
While it's not working well when selected FY19-Q2- It's taking the wrong data at the first place
 
 Need desired output for Running booked early
 
 
 
  • Hi Nimai123 ,

     

    Please give example data for these two tables and point out the relationship between them.

     

    Best regards,
    Lionel Chen

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

3 Replies

  • v-lionel-msft's avatar
    v-lionel-msft
    Community Support

    Hi Nimai123 ,

     

    Please give example data for these two tables and point out the relationship between them.

     

    Best regards,
    Lionel Chen

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

    • Nimai123's avatar
      Nimai123
      Post Patron

      Booking _reporting_view[cld_fq] 

       

      Qtr[Qtr Name]

       

      Taking Qtr[Qtr Name] in the slicer (additional information)

       

      No relationship between them I tried to make but ending up in M-M.

    • Nimai123's avatar
      Nimai123
      Post Patron

      I got the solution thanks I didn't make a relationship between them, after making it worked!

       

      Thanks