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
Hi Experts
I am trying to calculate current year Sales Dynamically - I am using the following measure which is returning zero..
Solved! Go to Solution.
Hi @Anonymous ,
First of all create a calculated column in Test Data table like this..
IsCurrentYear =
VAR TodayDate =
TODAY ()
VAR CurrentYear =
YEAR ( TodayDate )
RETURN
'Test Data'[Date Column] >= DATE ( CurrentYear, 01, 01 )
This column will return true or false..
After this create a measure like this...
Measure =
VAR CurrentYearSales =
CALCULATE ( SUM ( 'Test Data'[sales] ), 'Test Data'[IsCurrentYear] = TRUE () )
RETURN
IF ( CurrentYearSales = BLANK (), 0, CurrentYearSales )
If this works, kindly mark it as a solution. Appreciate with Kuddos.
Hello @Anonymous ,
try with the measure
CurrentYear = CALCULATE(
SUM('Test Data'[Sales]),
FILTER(ALL(
'Test Data'),'Test Data'[Year]=YEAR(TODAY())))
Hi @Anonymous ,
First of all create a calculated column in Test Data table like this..
IsCurrentYear =
VAR TodayDate =
TODAY ()
VAR CurrentYear =
YEAR ( TodayDate )
RETURN
'Test Data'[Date Column] >= DATE ( CurrentYear, 01, 01 )
This column will return true or false..
After this create a measure like this...
Measure =
VAR CurrentYearSales =
CALCULATE ( SUM ( 'Test Data'[sales] ), 'Test Data'[IsCurrentYear] = TRUE () )
RETURN
IF ( CurrentYearSales = BLANK (), 0, CurrentYearSales )
If this works, kindly mark it as a solution. Appreciate with Kuddos.
Thanks
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |