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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Remove incomplete week

Hi there,

 

I am plotting a weekly line chart with daily data. I am trying to not show the latest week's data point if the week is incomplete. 

 

My current solution does not work

Adm WK CY = 
VAR x = year( LASTDATE( MAIN_COR[DATE]))
VAR z = WEEKNUM( LASTDATE(MTDdate[Date]), 1)

Return 
CALCULATE( sum( MAIN_COR[ADM]),MAIN_COR[Attribute] = "Actual", MAIN_COR[Year] = x, MAIN_COR[Wkno] < z)

However, if I replace "z" with the current week number itself, "12", it works.

Where am I going wrong here?

4 REPLIES 4
vanessafvg
Community Champion
Community Champion

@Anonymous   have you returned(printed) all your variables to test  you are getting what you expecting?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

@vanessafvg Yes if I return the variable z, it gives me "12", the current week number.

@Anonymous  any chance you can share your pbix?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

I'm afraid I can't, perhaps can you suggest another way to go about doing it? I have included a picture of the line chart I am trying to fix for illustration. Adm WK CY for week 12 is irregular because the week is incomplete. Therefore I want to remove that point.

remove latest week.PNG

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.