Forum Discussion

abc_777's avatar
abc_777
Icon for Solution Specialist rankSolution Specialist
5 years ago
Solved

where is my error

Hi

 

is anyone help me out from my error please

 

Sale Total N days =
VAR ndaysselect =
SELECTEDVALUE ('N Days Sale'[MS Forum N Days Sale])
RETURN
SUMX (
FILTER (
BMCalendar,
BMCalendar[Date]
>= TODAY () + ndaysselect
&& BMCalendar[Date] <= TODAY ()
),
[Total Sales Measures]
)
 
 
Sale Total N days backward cumulate =
IF (
NOT ISBLANK ([Sale Total N days]),
CALCULATE (
[Sale Total N days],
FILTER (
ALLSELECTED ( BMCalendar),
BMCalendar[Date] >= MAX ( BMCalendar[Date])
)
)
)
 
 
thx
  • abc_777's avatar
    abc_777
    5 years ago

    Man you r genuus.

     

    you r right. Seriouslly your sight is perfect. in slicer I mistakenly change to greate than or equal to and thats because its made this issue.

    now i changed to single value and now its perfectly working

     

    thanks jihwan really you r genious.

13 Replies

  • abc_777's avatar
    abc_777
    Icon for Solution Specialist rankSolution Specialist

    Jihwan_Kim,

     

    Here is the formula

     

    Sale Total N days =
    VAR ndaysselect =
    SELECTEDVALUE ('N Days Sale'[MS Forum N Days Sale])
    RETURN
    SUMX (
    FILTER (
    BMCalendar,
    BMCalendar[Date]
    >= TODAY () + ndaysselect
    && BMCalendar[Date] <= TODAY ()
    ),
    [Total Sales Measures]
    )


    Sale Total N days backward cumulate =
    IF (
    NOT ISBLANK ([Sale Total N days]),
    CALCULATE (
    [Sale Total N days],
    FILTER (
    ALLSELECTED ( BMCalendar),
    BMCalendar[Date] >= MAX ( BMCalendar[Date])
    )
    )
    )

     

     

    • Jihwan_Kim's avatar
      Jihwan_Kim
      Icon for Super User rankSuper User

      Hi, abc_777 

      I am not sure about how your visualization looks like because I cannot see the first column's name, and I cannot know how the first column is related to your date column.

      The measure contains the date, but what is the first column in the picture representing?

       

      I assume that your first column represents the date of the month. Is it the date of the month and aggregating ALL months and ALL years? Or, is it already filtered by only one month and only one year?

      Sorry that I really cannot tell why by only seeing this.