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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
sppt
Frequent Visitor

Filter values that 'are not present'.

I hope I can describe the topic reasonably well. We have a cash register system that, in the case of discounts, does not flag the receipt itself, but only the receipt lines.

 

sppt_0-1719208303514.png

So if we now filter by a discount campaign in Power BI Desktop, we will of course only see those lines that have this marking. 

It also filters the receipt numbers that include the "Father's Day campaign" flag. So far, so good.

 

sppt_1-1719209602705.png

 

However, if I don't filter by the discount reason but by an individual receipt, we actually get exactly the result we need - but of course only on a receipt level and not across all receipts.

 

sppt_2-1719209906323.png

 

Of course, if we don't filter anything at all, the result is also "correct" - but we can't determine the turnover generated "despite" or "thanks to" a single discount campaign.

sppt_0-1719210575082.png

 

How is it possible to represent something similar in Power BI Desktop as in SQL?

For example, my thought would be something like:

 

SELECT [Receipt], [Turnover] FROM [Table1] 
WHERE [Table1].[Receipt] IN (SELECT [Receipt] FROM [TableWithReceiptNoAndDiscountReasonColumn])

 

2 REPLIES 2
Daniel29195
Super User
Super User

@sppt 

SELECT [Receipt], [Turnover] FROM [Table1] 
WHERE [Table1].[Receipt] IN (SELECT [Receipt] FROM [TableWithReceiptNoAndDiscountReasonColumn])

 

measure as follow : 

 

var ds_1 =  values(table1[receipt]) 

var ds_2 = values(TableWithReceiptNoAndDiscountReasonColumn[receipt]

 

var res = 

intresect ( ds_1 , ds_2 ) 

 

 

return 

switch( true()  ,  tbl[rec] in  res , 1 , blank() ) 

 

 

you can use this measure in the filter pane on the visual level.  --> is  =  1  .  or not is blank() . 

 

 

 

or you can instead of 

return 

switch( true()  ,  tbl[rec] in  res , 1 , blank() ) 

 

use : 

calculate (  count( tbl[receipt) , keepfilters( res ) ) 

 

 

let me know if this helps .

Hi Daniel,

 

I probably didn't express myself clearly. My data in Power BI looks as follows:

sppt_0-1719233981664.png

If I didn't have a tabular model, I would now create such an additional table via SQL and create a filter that gives me all receipts with the discount reason "20-10". It doesn't matter if this column is filled or not. It is sufficient that a single receipt line includes this discount to claim that we obtained the remaining turnover only because of this discount reason.

 

sppt_1-1719234302648.png

sppt_2-1719234313964.png

 


br

Patrick

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.