cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Atul8286
Regular Visitor

How to calculate blank rows from calculated measure by summarize other columns

Hello All,

I am trying to do the following thing but no luck.

Please find below the snapshot:

20220120_120150.jpg

Here, I need to calculate the total no of stores available in Banner(3rd Col), but need to apply a filter there, the Total Loss Amt(4th Col) should not be blank.

The No of stores is calculated as Calculate(count([StoreID]), All(store[StoreID]))

(I have used ALL because I need to calculate all the stores available in banner even if single store select it need to show all the stores)

 

For Eg: Here in D&D Banner 19 stores are there but [Total Loss Amt] is blank for three stores, so it should return only 16

 

Please help here

 

Thanks

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Atul8286 

 

I have tried to simulate some of the data hoping to restore your problem.

Measure:

The No of stores = 
CALCULATE (
    COUNT ( [StoreID] ),
    FILTER ( ALL ( 'Table' ), [Total Loss Amt] <> BLANK () )
)

This is where [Total Loss Amt] is Measure, and the method is the same if [Total Loss Amt] is a column.

vzhangti_1-1643098250672.png

If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?

 

Best Regards,

Community Support Team _Charlotte

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

View solution in original post

4 REPLIES 4
v-zhangti
Community Support
Community Support

Hi, @Atul8286 

 

I have tried to simulate some of the data hoping to restore your problem.

Measure:

The No of stores = 
CALCULATE (
    COUNT ( [StoreID] ),
    FILTER ( ALL ( 'Table' ), [Total Loss Amt] <> BLANK () )
)

This is where [Total Loss Amt] is Measure, and the method is the same if [Total Loss Amt] is a column.

vzhangti_1-1643098250672.png

If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?

 

Best Regards,

Community Support Team _Charlotte

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

Atul8286
Regular Visitor

Hi @Greg_Deckler ,

 

Thanks for uick reply.

 

I have tried this but it return "1" to every row.

Not useful for me.

 

Thanks

@Atul8286 I would need sample/example source data to understand what is going on. 

Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ me in replies or I'll lose your thread!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition
Greg_Deckler
Super User
Super User

@Atul8286 So like this?

Calculate(count([StoreID]), All(store[StoreID]), NOT(ISBLANK([Total Loss Amt])))

@ me in replies or I'll lose your thread!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors