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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
RobbLewz
Helper II
Helper II

Measure causing unrelated rows to show in table

I have two tables Dim Pot which is a one to many link to FactPotTransactions.

 

DROP TABLE IF EXISTS dbo.DimPot;
CREATE TABLE dbo.DimPot
	( Id INT IDENTITY (1,1) PRIMARY KEY
	, PotNo VARCHAR(10) NOT NULL
	, Amount DECIMAL(19,2) NOT NULL);
GO

INSERT	dbo.DimPot
		( PotNo, Amount )
VALUES	('5A', 300),
		('7B', 500),
		('10X', 1000);
GO

DROP TABLE IF EXISTS dbo.FactPotTransactions;
CREATE TABLE dbo.FactPotTransactions
	( TransId INT IDENTITY(1,1) NOT NULL PRIMARY KEY
	, PotNo VARCHAR(10) NOT NULL
	, Amount DECIMAL(19,2) NOT NULL
	, Auth VARCHAR(100) NOT NULL
	, TransDate DATE NOT NULL DEFAULT(GETDATE())
	);
GO

INSERT	dbo.FactPotTransactions
		( PotNo, Amount,  Auth)
VALUES	( '5A', 150, 'John Baker' ),
		( '5A', 50, 'John Baker' ),
		( '5A', 100, 'John Baker' ),
		( '7B', 300, 'Fred Jones' ),
		( '7B', 200, 'Fred Jones' ),
		( '10X', 500, 'Lisa Howells' );
GO

 

I want a simple table that shows the pot amount and the sum of all the transactions so far, but most importantly the amount remaing in the pot.

 

Spent = SUM (FactPotTransactions[Amount] )
Outstanding = [Spent] - SUM (DimPot[Amount] )

 

RobbLewz_0-1676907190690.png

 

When I add the amount, then it is bringing in people who are not assocaited with a pot

RobbLewz_1-1676907428619.png

 

The first line shows Fred Jones with an oustanding -300 but 5A isn't linked to any records with this person?

 

Why does SUM (DimPot[Amount] ) somehow break the relationship thats setup in the mode??

 

 

1 ACCEPTED SOLUTION
RobbLewz
Helper II
Helper II

It seems like the "solution" to this is enable filtering in both directions between the tables, even though thats not what I want as the fact table wont have transactions right away or at all for some pots.

There is a problem then, that if a row exists in DimPot, but has no trasnactions then it wont show in the table visual.

So you need to enable "show items with no data" in your filtered table, otherwise you will miss rows with no transactions.

Personally this feels like a bug - raised with Microsoft.

View solution in original post

3 REPLIES 3
RobbLewz
Helper II
Helper II

It seems like the "solution" to this is enable filtering in both directions between the tables, even though thats not what I want as the fact table wont have transactions right away or at all for some pots.

There is a problem then, that if a row exists in DimPot, but has no trasnactions then it wont show in the table visual.

So you need to enable "show items with no data" in your filtered table, otherwise you will miss rows with no transactions.

Personally this feels like a bug - raised with Microsoft.

Greg_Deckler
Community Champion
Community Champion

@RobbLewz In the visual is PotNo coming from the DimPot table or FactPotTransaction table?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

DimPot

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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