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
tqn3728
New Member

Previous Period using Calendar

I have a simple formula that worked in another file but doesn't seem to work in my current one. The same formula works in one workbook but not the other and im scratching my head on why it isn't working.

PY $ = VAR Previous = SELECTEDVALUE('Date Table'[Calendar YearWeekNumber])-1
RETURN
CALCULATE(
    [Gross Sales],
    'Date Table'[Calendar YearWeekNumber]=Previous)

 

1 ACCEPTED SOLUTION
ajaybabuinturi
Memorable Member
Memorable Member

Hi @tqn3728,
I reviewed the BI report. What happend over there is used two different columns in your model, used Calendar Year column to the visual and Calendar YearNumber for DAX logic. Because of that your getting BLANK values in the visual. You can refer below snippets and make sure that both visual fields and DAX logic columns should be same.

ajaybabuinturi_0-1750845589418.png

ajaybabuinturi_1-1750845633618.png

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

View solution in original post

4 REPLIES 4
ajaybabuinturi
Memorable Member
Memorable Member

Hi @tqn3728,
I reviewed the BI report. What happend over there is used two different columns in your model, used Calendar Year column to the visual and Calendar YearNumber for DAX logic. Because of that your getting BLANK values in the visual. You can refer below snippets and make sure that both visual fields and DAX logic columns should be same.

ajaybabuinturi_0-1750845589418.png

ajaybabuinturi_1-1750845633618.png

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

Interesting interaction, thank you for the help.

ajaybabuinturi
Memorable Member
Memorable Member

Hi @tqn3728,
This should be work however could you please share some sample data which this DAX logic is not working. So that will try to provide the solution. 

 

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.