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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bilogin
Helper I
Helper I

SUMPRODUCT Power Query to filter blanks

Afternoon,

 

So I've added a pivot table as a data source which looks like this:

 

Concat180118021803180418051806BLANKS
fn123410022 12 36877FALSE
fn1324510022      TRUE
fe13521687511 6 84FALSE

 

 

Concat = Product Code

1801, 1802 etc = Months of the year

 

In Excel, I would paste the pivot into a new tab and add the BLANKS column to see whether the product had been sold. The formula is: 

 

=SUMPRODUCT(--(B836:AF836<>0))=0

 

Is there an alternative I can use?

 

Secondary question: I'm using a pivot table as source data which would be updated one a month to include new sales data. If I create a Custom Column like the one above, would PBI know to insert a column for the new month or would it override the Custom Column? 

2 REPLIES 2
amitchandak
Super User
Super User

@bilogin , it should unpivoted

https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/

 

Also, share the expected output. Not clear with excel formula

@amitchandak the expected output for the SUMPRODUCT formula is as in the table - if the rows are blank or less than 0 (ie no sales have taken place), the formula will return TRUE. If the value is >0, the cell will return FALSE.

sumproduct.JPG

 

 

 

 

 

 

 

 

 

 

 

 

Pivoting the data didn't work, I tried Sales to Period even though both are numbers, I got the following error:

 

Expression.Error: We cannot convert the value null to type Text.
Details:
Value=
Type=[Type]

 

Thanks for your help.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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