Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Values for Current Month

I am trying to create a DAX measure that returns the sales budget for the current month. I want it to be optomized so I don't have to use filters on the visual or have to go in and change the DAX mea...
  • Ashish_Mathur's avatar
    1 year ago

    Hi,

    Create a Calendar Table with calculated column formulas for Year, Month name and Month number.  Sort the Month name column by the Month number.  Create a relationship (many to one and single) from the Date column of your Fact table to the date column of the Calendar Table.  Write these measures

    Measure = sum('sales&orderbudgets'[Bedget])

    This month's budget = calculate(measure],'sales&orderbudgets'[s/o]="s",datesbetween(calendar[date],eomonth(today(),-1)+1),eomonth(today(),0)))

    Hope this helps.