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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
L1102
Helper I
Helper I

Identifying a Product gap based off 2 data tables

Hello,

 

Hoping for some guidance. My set up is as per below.

 

Table 1: Sales Data Per Location Per Product

Table 2: Master Location List <-- Does not go down to the product level

Relationship between the tables : Location Name (1:Many)

 

Objective: Looking to build a table that once a product is select a lists will populate with all locations the product is not selling in.

 

My original thought was to set up a distinct count for both tables, build a table visual using table 2 location information, and filter against the distinct count measures by filtering in only counts that are blank.

 

It works perfectly on all location levels until I use any filter product related. Once I select the prodcut I want to evaluate, the table will only populate the stores that have sales against it. Do I need a different DAX rather than a simple distinct count?

 

I don't know if i'm making this too complicated, but any advice would be great!

 

Thanks in advance.

1 ACCEPTED SOLUTION
FreemanZ
Community Champion
Community Champion

hi @L1102 ,

 

Not sure if i fully get you, supposing you have two tables like below:

FreemanZ_0-1767838175895.png

and they are related on location column as many to 1.

 

Try the following:

1) plot a slicer with sales[product] 
2) plot a table visual with location[Location] 

3) write a measure like below:

FilterMeasure = 
VAR _count = DISTINCTCOUNT(Sales[product])
VAR _result = IF (_count>0, 1, 0) 
RETURN _result

4) pull the measure to the filter pan of the table visual and select 0.

 

it worked like:

FreemanZ_1-1767838501420.pngFreemanZ_2-1767838529353.png

 

Please find more info in the attached file.

View solution in original post

5 REPLIES 5
cengizhanarslan
Super User
Super User

  1. Create a Product dimension (distinct list of products) and relate it to Sales.

DimLocation[Location] (1) → Sales[Location] (*)

DimProduct[Product] (1) → Sales[Product] (*)

Then use slicers from dimensions, not from the Sales fact.

 

2. Put DimLocation[Location] in a table visual, then add this measure:

Has Sales :=
IF ( CALCULATE ( COUNTROWS ( Sales ) ) > 0, 1, 0 )

Now filter the visual: Has Sales = 0

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.
FreemanZ
Community Champion
Community Champion

hi @L1102 ,

 

Not sure if i fully get you, supposing you have two tables like below:

FreemanZ_0-1767838175895.png

and they are related on location column as many to 1.

 

Try the following:

1) plot a slicer with sales[product] 
2) plot a table visual with location[Location] 

3) write a measure like below:

FilterMeasure = 
VAR _count = DISTINCTCOUNT(Sales[product])
VAR _result = IF (_count>0, 1, 0) 
RETURN _result

4) pull the measure to the filter pan of the table visual and select 0.

 

it worked like:

FreemanZ_1-1767838501420.pngFreemanZ_2-1767838529353.png

 

Please find more info in the attached file.

Thank you so much for this!!

lbendlin
Super User
Super User

To report on things that are not there you need to use disconnected tables and/or crossjoins.

 

Your product filter needs to come from such a disconnected table.  Then use a measure as a visual filter to include only the rows that do not satisfy the filter choice.

@lbendlin my data set is pretty massive, I tried this and Power BI have been sitting at "working on it" for a while.

 

Hoping there is some other work around someone can magically conjure up.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.