Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculate and filter

Hi,

So I've a measure that is telling me what current week in Data i have

Actual WW = CALCULATE(MAX(WholeData[WW - Number]),WholeData[Year]="2019")

And then i want to create measure that will be last year YTD 

2018 YTD = CALCULATE(SUM(WholeData[Semi-Net Revenue]),FILTER(WholeData,(WholeData[WW - Number]<=[Actual WW])&& WholeData[Year]="2018"))
and it's returing blank
I found out that "Actual WW" is returning 0 (only in 2018 YTD) but if i will change WholeData[Year]="2018" to "2019" then it does return correct number. 
Any solution? 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

I found solution:

 

2018 YTD =
VAR WWNumber = [Actual WW]
Return
CALCULATE(
SUM(WholeData[Semi-Net Revenue]),
(WholeData[WW - Number]<=WWNumber),
WholeData[Year]="2018"
)

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I found solution:

 

2018 YTD =
VAR WWNumber = [Actual WW]
Return
CALCULATE(
SUM(WholeData[Semi-Net Revenue]),
(WholeData[WW - Number]<=WWNumber),
WholeData[Year]="2018"
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.