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

Values appearing but also showing as null, why???..

Here's a strange thing:

This is my formula for the Year-week of the most recent order from the clients:

Most Recent Order YearWeek =
var most_recent_week = calculate(MAX(Sales[Year_Week]))
return most_recent_week
 
The result is fine but it's ugly:
annexiao_0-1643080265335.png
Before it was fine - when I changed the formula to this:
Most Recent Order YearWeek =
var most_recent_week = calculate(MAX(Sales[Year_Week]))
return 
if(ISBLANK(most_recent_week),"",
left(most_recent_week,4)
&"-"
&right(most_recent_week,2))
 
Then it's much better looking:
annexiao_1-1643080328399.png

However, just today I found that it became like this: 

 

annexiao_2-1643080444718.png

When I tried to debug and changed the return to --isblank(most_recent_week), I found it's like this:

annexiao_3-1643080961497.png

Why??? Why does it have all the values and then shows as blank??

Can you help me figure out ?...
Thank you in advance!
4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous 

In your formula , when [most_recent_week] is null , return “” , so you need check the value of [most_recent_week] . If you still have doubts , you can provide your pbix file to us, it will help us to deal with your problem easier .

Ailsamsft_0-1643248708884.png

Best Regard

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , just try this

calculate(MAXX(allselected(Sales),Sales[Year_Week]))

 

if you need data of max week use this in visual level filter or

 

create measure like

var _max = calculate(MAXX(allselected(Sales),Sales[Year_Week]))

return

calculate(sum(Sales[AMount]), filter(Sales, Sales[Year_Week] =_max) )

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi, 

Thanks for your response. It doesn't work and give me this:

annexiao_0-1643081979526.png

 

It's year-week because var_max is what i wanted to return 

@Anonymous ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.