March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi Guys
I've experienced that I seem to have an issue with writing Dax measures. I keep getting errors when refering to table Columns.
What am i doing wrong? is there a setting that i have to change somewhere?
Solved! Go to Solution.
@MacJasem Missed a closing paren: ALL('Date'),
7DayRunningTotal =
CALCULATE(
[SalesValue],
FILTER(
ALL('Date'),
'Date'[Date] > MAX('Date'[Date]) - 7 && 'Date'[Date] <= MAX('Date'[Date])
)
)
I got inspiration from your colleague Sam McKay (Enterprise DNA) with regards to calculating previous week sales:
This time I even used DaxFormatter to make sure nothing was missed, and the formatting came out fine, but i still got this error in PowerBI. Couldn't really figure out what the issue is. Any idea?
PreviousWeekSales =
VAR CurrentWeek =
SELECTEDVALUE ( 'Date'[Week Number] )
VAR CurrentYear =
SELECTEDVALUE ( 'Date'[Year] )
VAR MaxWeekNumber =
CALCULATE ( MAX ( 'Date'[Week Number] ), ALL ( 'Date' ) )
RETURN
SUMX (
FILTER (
ALL ( 'Date' ),
IF (
CurrentWeek = 1,
Date[Week Number] = MaxWeekNumber
&& 'Date'[Year] = CurrentYear - 1,
Date[Week Number] = CurrentWeek - 1
&& 'Date'[Year] = CurrentYear
)
),
[SalesValue]
)
@MacJasem Missed a closing paren: ALL('Date'),
7DayRunningTotal =
CALCULATE(
[SalesValue],
FILTER(
ALL('Date'),
'Date'[Date] > MAX('Date'[Date]) - 7 && 'Date'[Date] <= MAX('Date'[Date])
)
)
Overthought that one without checking the formating - how embarrasing 😂
Thanks @Greg_Deckler, much appreciated the swift reply!🙏
@MacJasem Happens!! 🙂
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
25 | |
16 | |
15 | |
7 | |
7 |
User | Count |
---|---|
37 | |
31 | |
16 | |
16 | |
12 |