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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Wresen
Post Patron
Post Patron

Sum values but dont show blanks

Hi 

I have a little problem that i have tried to solve , not sure if its possible.

I have two tables.

 

box1.pngBox2.png

They have an relationship between Box - Box , single (right to the left table (bigger table)

 

What i try to archive is like picture below: (dont want the sum on the blank Boxes like the last picture)

box3.png

I have tried with this code:

Sum Month Box =
Var month = SELECTEDVALUE('Raw Box'[Month])
VAR val =
CALCULATE (
sum ('Raw Box'[Count] );
FILTER (ALL( 'Raw Box') ; 'Raw Box'[Month] =month)
)
return val

 

But the output looks like this:

Box4.png

is it possible to archive that "forces" the sum on the 1-4 boxs even though they are blank in the bigger table and also dont show Sum on a Blank Box value

 

/Thanks so much for any help or suggestion.

 

3 ACCEPTED SOLUTIONS

@Wresen here is the measure and what you need on filter

 

Measure = CALCULATE( COUNTROWS ( 'Box Tran' ), ALLEXCEPT( 'Box Tran', 'Box Tran'[Month] ) ) 

image.png

 

 

In table visual, drop Month and Box from (box table) and the measure above. and you will get this

 

image.png



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

Hi @Wresen 

 

Try using ALLNOBLANKROW in place of ALL, as follows:

 

Runningcount =
SUMX (
    FILTER (
        ALLNOBLANKROW ( 'Box Table'[Box] ),
        'Box Table'[Box]
            <= MAX ( 'Box Table'[Box] )
    ),
    [Amount]
)

View solution in original post

Sorry @Wresen ,

 

I forgot to mention that you'll also need to apply a filter on the 'Box' column in the visual:

 

Capture.JPG

View solution in original post

14 REPLIES 14
MartynRamsden
Solution Sage
Solution Sage

Hi @Wresen 

 

If you delete the relationship between the two tables, you should get the result you're looking for.

However, doing this could break other parts of your data model or cause other measures to calculate incorrectly, so proceed with caution.

 

Best regards,

Martyn

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Wresen,

 

try this...

 

20191122_Showdata.png

20191122_Filter_notBlank.png

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Hi mwegener

 

i really appriciate the help but i am not sure what you mean ,if i do that i just blanks out the table

 

box5.png

I want the "end product" to look like; 

box3.png

mwegener
Most Valuable Professional
Most Valuable Professional

Hi  @Wresen , 

how about a calculated table?

 

 

Table =
CROSSJOIN (
    SUMMARIZE (
        'Raw Box';
        'Raw Box'[Month];
        "Sum Month Box"; 'Raw Box'[Sum Month Box]
    );
    Box
)

 

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Hi mwegener

 

Its needs to be i a measure i am affraid , sorry for not making that clear , but thanks so much for the sugestion.

 

@Wresen here is the measure and what you need on filter

 

Measure = CALCULATE( COUNTROWS ( 'Box Tran' ), ALLEXCEPT( 'Box Tran', 'Box Tran'[Month] ) ) 

image.png

 

 

In table visual, drop Month and Box from (box table) and the measure above. and you will get this

 

image.png



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi  

 

Thanks so much for that code , is it possible to modify so i do not need to the filter thing in the filters.

My tought is to use 2 more measures in this report , one measurethat count the nr of boxes that have box 1-4 and also a measure  of Cumulative count of box 1-4.

The problem i will face if i have values at the blank Box and "just filter them away" the resulat will be wrong since the measures will ignore the filter we applyed.

 

I hope i make sense in what i am trying to archive 🙂

 

@Wresen send the pbix file with sample data and expected result.  Remove any sensitive information before sharing.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Stupid question but how do i attach i file , cant find the option to do that (just photos or Insert Video)

Hi @Wresen ,

You need to have a cloud storage such as Onedrive or Google Drive where you can put your file. After that, you create a shareable link that you can insert in your post enabling people to download the pbix.

Best Regards,

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

Hi

I hop i have done it correct , the file is in "Box sum" bellow

 

What i am trying to do is: 

box6.png

but i get :

 

box7.png

(What i want is the measure's to ignorne the "blank" box in the calculations. I needs to be in measures and i need to have the relationship since hoppfully i will conect other data to the "Box Table")

 

(Credit to parry2k for the Totalsum measure)

 

 Box sum 

Hi @Wresen 

 

Try using ALLNOBLANKROW in place of ALL, as follows:

 

Runningcount =
SUMX (
    FILTER (
        ALLNOBLANKROW ( 'Box Table'[Box] ),
        'Box Table'[Box]
            <= MAX ( 'Box Table'[Box] )
    ),
    [Amount]
)

Sorry @Wresen ,

 

I forgot to mention that you'll also need to apply a filter on the 'Box' column in the visual:

 

Capture.JPG

Hi MartynRamsden

 

Thanks so much for the help.

I have tried your suggestion in a bigger model (where i connect more data) and it works as i want.

 

 

Thanks also to all who has come upp with suggestion to help me and my report.

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors