Forum Discussion
Midway
Helper I
1 year agohelp with DAX MTD
Hi there, I'm really struggling with this calculation with this DAX measure; What I need to accomplish is show let's sales numbers in a card. When a month is selected in another visual (like a time...
- 1 year ago
var dt = eomonth( MAXX( summarize( fact, DimDate[Date] ), dimdate[date]), 0)
return
CALCULATE(
SUM(Fact[SALES]),
DATESBETWEEN( DimDate[Date], EOMONTH( dt, -1) + 1, dt )
)
Pow3Range
1 year agoFrequent Visitor
UPDATED
-------
VAR DATE_ =
IF(
ISFILTERED(DimDate[Date]),
MAX(DimDate[Date]),
TODAY()
)
RETURN
CALCULATE(
SUM(Fact[SALES]),
DATESBETWEEN(DimDate[Date], EOMONTH(DATE_, -1) + 1, EOMONTH(DATE_, 0))
)
- Midway1 year ago
Helper I
Thanks for replying to my post, this gets the default sales numbers for the current month when no selection has been made, but it keeps the same current month sales numbers when selecting other months.