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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

What would power bi return if there is no value?

Hi,

 

I'm trying to use if conditional function to sort out data. But if there is no value what would power bi return? 

For example, my data table only contains more than 1 quantity. I want to visualize or count number of customer who have not purchased for last 2 years.  In my data customer A purchased 3 years ago, which is the only data in my excel but Customer A did not purchased any product for last 2 years and I want to mark this customer with 1, others who have purchased 1 or more products in last 2 years with 0. 

If there is no actual data that states customer A purchased 0 for last 2 years, would Power bi consider Blank or 0?

If it returns blank then, I might use this formula:

Case 2-1 = if(calculate(sum(product[quantity]),datesinperiod(Calendar[Date],max(Calendar[Date]),-2,year))=BLANK(),1,0)
If it returns 0 then, I might use this one:
Case 2-1 = if(calculate(sum(product[quantity]),datesinperiod(Calendar[Date],max(Calendar[Date]),-2,year))=0,1,0) or
Case 2-1 = if(calculate(sum(product[quantity]),datesinperiod(Calendar[Date],max(Calendar[Date]),-2,year))<1,1,0)
2 ACCEPTED SOLUTIONS
Pragati11
Super User
Super User

Hi @Anonymous ,

 

If you have got value 0 in your data that represents that customer hasn't purchased in last two years; then Power BI will take it as zero.

If the column has empty values or blank values; Power Bi will consider it BLANKS.

 

So, whatever you feed to Power BI, it will consider that data that way.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

amitchandak
Super User
Super User

@Anonymous , power bi would return blank().

To avoid that you can add +0 , but that will make left join and all values will be used

 

this example of sold in 3 months and not sold in last three month

Rolling 3 Sales = CALCULATE(sum(Retail[Qty]),DATESINPERIOD('Date'[Date],max('Date'[Date]),-3,MONTH))

Rolling 3 Not Sold = if(CALCULATE(sum(Retail[Qty]),DATESINPERIOD('Date'[Date],max('Date'[Date]),-3,MONTH)) +0>0,blank(),1)

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , power bi would return blank().

To avoid that you can add +0 , but that will make left join and all values will be used

 

this example of sold in 3 months and not sold in last three month

Rolling 3 Sales = CALCULATE(sum(Retail[Qty]),DATESINPERIOD('Date'[Date],max('Date'[Date]),-3,MONTH))

Rolling 3 Not Sold = if(CALCULATE(sum(Retail[Qty]),DATESINPERIOD('Date'[Date],max('Date'[Date]),-3,MONTH)) +0>0,blank(),1)

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
Pragati11
Super User
Super User

Hi @Anonymous ,

 

If you have got value 0 in your data that represents that customer hasn't purchased in last two years; then Power BI will take it as zero.

If the column has empty values or blank values; Power Bi will consider it BLANKS.

 

So, whatever you feed to Power BI, it will consider that data that way.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

vanessafvg
Super User
Super User

you can use

if(isblank(field),0,(field))




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!




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.