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
Anonymous
Not applicable

Column used in measure and Used in table as well

Hello,

 

I have some trouble with Dax & Power BI

 

I' using a column as a filter in a Measure : 

 

Total_Amount = CALCULATE(SUM(Table[amount]);Dimension[Filter_Column]="Primary Cost")

 

The when I'm adding the measure to the Table Visual, everythink was OK :

1.JPG

 Untill I added the Filter_column to the visual and everything is wrong except the TOTAL of the table visual :

2.JPG

 

There's any solution for this??

Is this a bug Dax or it's working like that in Power BI?

Thanks a lot for your responses

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi there.

 

First, your measure must be written like this:

Total_Amount =
	CALCULATE ( 
		SUM ( Table[amount] ),
		KEEPFILTERS( 
			Dimension[Filter_Column] = "Primary Cost"
		)
	)

Secondly, please NEVER, EVER join 2 fact tables directly to each other. Unless you want to suffer and re-build your model from scratch later on.

 

Best

D

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi there.

 

First, your measure must be written like this:

Total_Amount =
	CALCULATE ( 
		SUM ( Table[amount] ),
		KEEPFILTERS( 
			Dimension[Filter_Column] = "Primary Cost"
		)
	)

Secondly, please NEVER, EVER join 2 fact tables directly to each other. Unless you want to suffer and re-build your model from scratch later on.

 

Best

D

mahoneypat
Microsoft Employee
Microsoft Employee

That is the behavior of DAX.  The filter in the calculate is overriding the filter from the visual if on the same column (hence all the same values).  You could just simplify your measure back to Sum(Table[Amount]) since your visual is doing the filtering now.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Hello @mahoneypat

 

I think the probleme is about the use of the USERELATIONSHIP 

Total_Amount =
CALCULATE (
SUM (Fact2[Amount] );
DATESYTD( 'Date_Table'[Date] );
FILTER ( Dimension; Dimension[Filter_Column] = "Physical");
USERELATIONSHIP ( Fact2[ID]; Fact1[ID] )
)

 

This is my Schema :

 

Capture14.JPG

 

 

I think when we want to across the dimension column returned from the USERELATIONSHIP then I cant see nothing as result 

 

I think it's a DAX Logic

I don't think it is the USERELATIONSHIP().  Since you have added the column to your visual that you were filtering on in the measure, have you tried the simpler measure

 

Total Amount = Sum(Fact2[Amount])

 

Looking at your model, the filter should propagate from your Dim table to the Fact2 table.  I would discourage bi-di relationships, but this should work in your model.  If you have a 1:1 between Fact1 and Fact2 I would consider merging them in query editor to simplify things.

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.