Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi I have below measure which is working perfectly fine and giving expected results.
12wks Dollars:=CALCULATE([Dollars],FILTER(Metrics_Table, Metrics_Table[Agg_Level]= 12))
But when I try to write below measure 12wks Dollars year ago it is throwing an error,
12wks Dollars YAGO:=CALCULATE([Dollars],FILTER(Metrics_Table, Metrics_Table[Agg_Level]= 12 & Metrics_Table[AO_Date]=dateadd(Metrics_Table[AO_Date],-364,Day)))
Also I have dates_table too with Date_Anchor_YAgo field(exactly 52 weeks back date as shown below,
Metric table and date table are both having relationship.
If it is better to use Date_Anchor_YAgo field from dates table ,how can i write my 12wks Dollars YAGO measure correctly?
Thanks..
Solved! Go to Solution.
Hi @smeg,
You can try to use the following measure formula if it works on your side: (I modify the DATEADD function to use with extracted calendar date values as condition in formula calculations)
12wks Dollars YAGO :=
VAR currDate =
MAX ( Calendar[Date] )
RETURN
CALCULATE (
[Dollars],
FILTER (
ALLSELECTED ( Metrics_Table ),
Metrics_Table[Agg_Level] = 12 & Metrics_Table[AO_Date]
= DATE ( YEAR ( currDate ) - 1, MONTH ( currDate ), DAY ( currDate ) )
)
)
Regards,
Xiaoxin Sheng
Hi @smeg,
You can try to use the following measure formula if it works on your side: (I modify the DATEADD function to use with extracted calendar date values as condition in formula calculations)
12wks Dollars YAGO :=
VAR currDate =
MAX ( Calendar[Date] )
RETURN
CALCULATE (
[Dollars],
FILTER (
ALLSELECTED ( Metrics_Table ),
Metrics_Table[Agg_Level] = 12 & Metrics_Table[AO_Date]
= DATE ( YEAR ( currDate ) - 1, MONTH ( currDate ), DAY ( currDate ) )
)
)
Regards,
Xiaoxin Sheng
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
8 |
User | Count |
---|---|
13 | |
12 | |
11 | |
10 | |
8 |