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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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