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
Anonymous
Not applicable

Create reference of 0 count for each row

Hi,

 

I have a series of rows in a table like the following. 

 

IndexIDCategory
1ID_1A
2ID_2B
3ID_3C
4ID_4A
5ID_4B
6ID_5C

 

Due to some reasons, I have to create a dummy row for each row (duplication), so that I have reference of count = 0 for each entry and its category. I have to do this to correctly show the data in a custom visual.

 

IndexIDCategory
1ID_1A
2ID_1dummy
3ID_2B
4ID_2dummy
5ID_3C
6ID_3dummy
7ID_4A
8ID_4dummy
9ID_4B
10ID_4dummy
11ID_5C
12ID_5dummy

 

The measure I use after duplication is: 

measure = IF( MAX('Table'[Category]) = "dummy",0 , COUNT('Table'[Category]))
 
 
What is the alternative method so that I don't do this duplication? I just need a reference of count = 0 for each entry. 
2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

Have you tried just adding + 0 to your current expression (so that any values that were previously blank now show as 0)?

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

The issue is not related to blanks.

The reason I do the duplication is that I need a reference of count = 0 for each category count. In this way, the custom visual can compare its real count with this 0 reference. Otherwise, the custom visual won't know how to treat the colors. I use the measure I said in the visual.

 

Is there any other method to do this task without duplication?

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.