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
smmoore34
Helper III
Helper III

Create a measure that refers to a specific field in a column

I have  the following table with (2 columns)

Year   # Incidents

2022  98756

2023  12354

2024   64789

 

The  year is linked to my other tables. When I filter on year I want to have a measure to use in a card that shows the # incidents in that year. 

1 ACCEPTED SOLUTION
Kaviraj11
Super User
Super User

Total Incidence = 

var _selecteddate=FIRSTDATE('Calendar'[Date])
return CALCULATE(SUM(Tablename[# Incidents])+0,TREATAS({_selecteddate},'Calendar'[Date]))



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

4 REPLIES 4
Kaviraj11
Super User
Super User

Can you share the PBIX File?

I need more details to understand the data type as well. Please elaborate it




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





I beleive I have figured this out. Thank you for your assistance, I'll accept your first solution.

Kaviraj11
Super User
Super User

Total Incidence = 

var _selecteddate=FIRSTDATE('Calendar'[Date])
return CALCULATE(SUM(Tablename[# Incidents])+0,TREATAS({_selecteddate},'Calendar'[Date]))



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





I'm not clear on what to enter for the Calendar'[Date]).

My "main_table" has a column called 'Year' which is extracted from a Date field in this table. 

This 'year' column is linked to my table called "incident_counts" that has the following columns:

Year   # Incidents

2022  98756

2023  12354

2024   64789

If the data is filtered on the year 2022 for example, I want a measure that will return the value of '98756'.

 

 

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