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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Vaibhav05
Helper I
Helper I

How to showcase the KPI and data as 0 when the data is not available for particular year?

Hi Team,

I am currently creating Data for different KPIs, from multiple sources into 1 Pager in Matrix visual in Power BI desktop. However in 1 of the KPI named "eNPS", the data is till 2023 and does not have any data for 2024. Now the management wants that the data in that KPI needs to be visible as 0 in the table when we select 2024.

below is how the Visual currently looks:

when we select year 2023:

Vaibhav05_1-1730807112279.png

And when select Year as 2024, the KPI is not showing as data for 2024 is not in KPI so whole KPI is not visible:

Vaibhav05_2-1730807258566.png

 

How do we showcase the KPI and its data (as 0) even the data for that KPI for any year is missing ?


Thanks
Vaibhav



6 REPLIES 6
v-kaiyue-msft
Community Support
Community Support

Hi @Vaibhav05 ,

 

You can refer to this example. In my data, there are only data from 2013 and 2014. Instead of the original result, you can create a measure that returns 0 when the calculation is blank.

 

Measure = 
VAR _year = SELECTEDVALUE('DAX DateTable'[Year])
VAR _sum = CALCULATE(SUM('financials'[ Sales]),FILTER('financials','financials'[Year] = _year))
RETURN
IF(_sum = BLANK(), 0, _sum)

 

 

vkaiyuemsft_0-1730859935824.pngvkaiyuemsft_1-1730859942553.png

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

Hi v-kaiyue-msft,

Thnaks you for the solution, when implemented it breaks the Matrix visual. In the visual we have Monthly and Yearly Targets coming from different files.
So is there any other way to make KPI visible with 0 values for missing year ?

How the visual looks before the measure:

Vaibhav05_1-1730893756925.png

 

And how that looks after applying the measure

Vaibhav05_0-1730892996341.png

 

Hi @Vaibhav05 ,

 

Can you share sample data in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

 

Best Regards,

Clara Gong

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

Hi Clara,

Basically, we are appending the data from different KPIs (having different data sources) in 1 single table and showcasing it on 1 page along with Monthly and Yearly Targets. (As below screenshot),

Vaibhav05_1-1731062039202.png

I dont have the access to attach the Power BI file.  Is there any other way that i can share my file ?

Thanks

Vaibhav

Hi @Vaibhav05 ,

 

You can upload the PBIX file to a cloud storage service such as OneDrive, Google Drive (set up public access), SharePoint, or a Github repository, and then share the URL of the file.

 

 

Best Regards,

Clara Gong

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

Tutu_in_YYC
Super User
Super User

You can use COALESCE in your DAX measure.
https://learn.microsoft.com/en-us/dax/coalesce-function-dax

You can choose to return 0 when the value is blank. I suggest you do this as a separate measure as it will visualize 0 for any blank values.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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