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 )
)
bhanu_gautam
Super User
1 year agoMidway Use DAX
SalesMeasure :=
IF(
ISFILTERED(DimDate[Month]),
CALCULATE(
SUM(Fact[SALES])
),
CALCULATE(
SUM(Fact[SALES]),
DATESMTD(DimDate[Date])
)
)