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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
AKFM
New Member

Forecast in KPI Visual does not work, if not sold every day

Hello guys,

I would like to create a KPI visual in PowerBI Desktop that forecasts the current sales of a product group for the end of the year and compares it with the annual target.

The DAX formula is quite simple:
(([sales in tons YTD]/[working day number in year])*[working days in year])
The formula works, if I simply display it as a number, the result is correct.

Problem: As soon as this product group has not been sold on one day, the KPI visual (as well as the table visual) shows a 0 instead of the correct number.

With each unsold day, the forecast should decrease slightly because the number of remaining days in the year decreases, as you can see in the screenshot. On 12.01. there were still 78 tons forecast, since then no more sales, so the single visual shows 70 tons. In the KPI visual or in the table, however, it simply shows 0.

AKFM_0-1705475338748.png

 

Best Regards

1 ACCEPTED SOLUTION
AKFM
New Member

It works since I changed the date source of the KPI visual. Now I have the date directly from the invoice table and no longer the date from the date table. The date table was properly marked as a date table and linked to the invoice table.

View solution in original post

3 REPLIES 3
AKFM
New Member

It works since I changed the date source of the KPI visual. Now I have the date directly from the invoice table and no longer the date from the date table. The date table was properly marked as a date table and linked to the invoice table.

Anonymous
Not applicable

Hi @AKFM 

 

Based on your description, it seems that your KPI visual is showing 0 because the measure you are using for the indicator is blank when there are no sales for a day. A possible solution is to use a measure that returns 0 instead of blank when there are no sales, such as:

 

Forecast = 
IF ( 
    ISBLANK([Sales in tons YTD]), 
    0, 
    ([Sales in tons YTD] / [Working day number in year]) * [Working days in year])

 

Regards,

Nono Chen

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

Hi @Anonymous 

Thanks for your answer.
Unfortunately, this makes no difference, because the ISBLANK is already included in my [Sales in tons YTD] DAX.
[Sales in tons YTD] is also not empty if there were no sales on one day, because [Sales in tons YTD] is the total to date.

On the screenshot you can see the [Sales in tons YTD], that is the 3 t, so it is not empty. The DAX forecast itself also shows the correct result, which is 70 tons in the screenshot. Only in combination with a date does it not seem to work (KPI, Table Visual).

Best regards

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.