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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Smamwise
Frequent Visitor

Calculated column based on a measure in another table

Hi!

 

I have a issue which I cannot wrap my head around.

 

I have four tables:


Dimension Item,
Fact StockEvent,

Dimension EventDate,
Dimension EventType

Those are connected as 

Smamwise_0-1700647077985.png

 

 

In StockEvent table I have a measure:

CountFilteredEvents = CALCULATE ( COUNTROWS(StockEvent), FILTER ( StockEventType,[EventType] in {"T1","P1","P2"} ) )
This works fine, gives me the count of rows with correct filter. Works with date filter also in report.
 
In Item table I would need a calculated column as:
Has Stock Events? = IF ( [CountFilteredEvents] >= 1, "has events", "no events" )

Though this gives me "has events" on every row, even if there are none. This seems to disregard the date filter.

Measure with the same dax works fine.

 

I know that the column is calculated at a row level and the measure at a filter level but I'm not sure what to do with that information. I would appreciate any assistance 

1 REPLY 1
HotChilli
Super User
Super User

There are a few misconceptions in the question.  Measures are for visuals, calculated columns are for adding columns to tables - they are calculated at refresh time.  Calculated columns do not change according to visual filters.

It is not a good idea to create a calculated column which uses a measure.

--

"In StockEvent table I have a measure" - a measure has a 'home' table.  It means nothing. A measure has no value until it's added to a visual.

--

Re-write these both as calculated columns or use power query.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors