Forum Discussion
Pikachu-Power
5 years agoImpactful Individual
DAX optimization: ValueMonth minus ValueMonthBefore
Hi all, i have the following measure that works fine. but is there a way to write it more compact? I have created two sepatated month and year tables and integrated the SELECTEDVALUE in the formu...
- Anonymous5 years ago
have a try with your connected Calendar
test = VAR CurSales = CALCULATE ( SUM ( Tabel1[Value] ), Tabel1[Categorie] = "A" ) VAR PreSales = CALCULATE ( SUM ( Tabel1[Value] ), Tabel1[Categorie] = "A", DATEADD ( Calendar[Date], -1, MONTH ) ) RETURN CurSales - PreSales
Pikachu-Power
5 years agoImpactful Individual
Hi Vera,
many thanks for your idea. Is it also possible to use the connected calender table and get rid of the separated year / month table? i think it will be than more difficult to show the previous month/year, right?
Anonymous
5 years agoNot applicable
have a try with your connected Calendar
test =
VAR CurSales =
CALCULATE ( SUM ( Tabel1[Value] ), Tabel1[Categorie] = "A" )
VAR PreSales =
CALCULATE (
SUM ( Tabel1[Value] ),
Tabel1[Categorie] = "A",
DATEADD ( Calendar[Date], -1, MONTH )
)
RETURN
CurSales - PreSales
- Pikachu-Power5 years agoImpactful Individual
Great thank you 👍😊