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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

DAX Expression - Field Heirarchy

I have a simple sales report table with a field for the date, which includes year / month / day, and I want to create a role which filters the other information by the year but don't know how to express it.

 

I tried to enable date heirarchy and then deselect month / day, and then express it as: [Year] = "2013"

 

But I am new to Power BI (and scripting language in general)

 

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

You could try to add filter like the formula below. 

Measure = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[Date].[Year] = 2018))

Otherwise, you could create a new column of "YEAR" and then use it to filter.

YEAR = YEAR('Table'[Date])
Measure 2 = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[YEAR] = 2018))

 2.PNG

If I understand incorrectly, please share some sample data and your expected results. Then we will unerstand clearly.

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

You could try to add filter like the formula below. 

Measure = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[Date].[Year] = 2018))

Otherwise, you could create a new column of "YEAR" and then use it to filter.

YEAR = YEAR('Table'[Date])
Measure 2 = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[YEAR] = 2018))

 2.PNG

If I understand incorrectly, please share some sample data and your expected results. Then we will unerstand clearly.

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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