Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Power bi reference file download from drop Box
Dear gurus ,
wrt the attached pbix link
Pls help me understand why below measure is not working vs further below is working
Measure to compute sales YTD . .
Sales Amount YTD working =
VAR LastVisibleDate = MAX ( 'Date'[Date] )
VAR CurrentYear = YEAR ( LastVisibleDate )
VAR SetOfDateesYtd =
FILTER (
ALL ( 'Date'),
AND (
'Date'[Date] <= LastVisibleDate,
YEAR ( 'Date'[Date] ) = CurrentYear
)
)
VAR Result =
CALCULATE (
SUMX ( Sales, Sales[Net Price] * Sales[Quantity] ),
SetOfDateesYtd
)
RETURN
Result
but below is working
Sales Amount YTD working =
VAR LastVisibleDate = MAX ( 'Date'[Date] )
VAR CurrentYear = YEAR ( LastVisibleDate )
VAR SetOfDateesYtd =
FILTER (
ALL ( 'Date'),
AND (
'Date'[Date] <= LastVisibleDate,
YEAR ( 'Date'[Date] ) = CurrentYear
)
)
VAR Result =
CALCULATE (
SUMX ( Sales, Sales[Net Price] * Sales[Quantity] ),
SetOfDateesYtd
)
RETURN
Result
After you look at the model you will shout at me that why the date table is linked via Date key but not the date which will fix the problem .
But that is not my point , my point is for learning , lets assume that model cant be changed and we are overcoming in DAX layer
This is something related to claculate overriding the date filter in one versus other but I am not able to figure out point blank exactly.
I need a precise answer , I know that something to do with calculate overriding date filter . . but not able to figure it out exactly how .
Solved! Go to Solution.
Hi, @DhrubojitG
in your first code you use all('date') as a table refrence so you ignoring all filter of that table(date) means ignoring all filter coming from all columns of date table . you not ignoring filter from date[date] column so it override existing filter of another column(except date[date]) column.
in second query you specify one column date[date] so it ignore only that column filter
so you get stuck there and not getting proper answe
read below artical for more information article 1 , article 2
and refer below video video 1
Hi, @DhrubojitG
in your first code you use all('date') as a table refrence so you ignoring all filter of that table(date) means ignoring all filter coming from all columns of date table . you not ignoring filter from date[date] column so it override existing filter of another column(except date[date]) column.
in second query you specify one column date[date] so it ignore only that column filter
so you get stuck there and not getting proper answe
read below artical for more information article 1 , article 2
and refer below video video 1
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 20 | |
| 12 | |
| 12 |