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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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