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
lennox25
Post Patron
Post Patron

How to create columns in a table to show Years 2017, 2018, 2019, 2020 etc

Using my date table which has a 'Year' Column. How do I create a measure for 2017, 2018, 2019, 2020 etc so that they will show in columns on a table?

 

Category201720182019
A492265
B331123
1 ACCEPTED SOLUTION
serpiva64
Solution Sage
Solution Sage

Hi,

try 

SalesAmount2017 = CALCULATE(Sales[Sales Amount], 'Date'[Year]=2017)
and so on for other years
If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

View solution in original post

3 REPLIES 3
tackytechtom
Super User
Super User

Hi @lennox25 ,

 

You could create your measure without an explicite filter and then let Power BI do the grouping and filtering for you, i.e. in a matrix visual:

 

tackytechtom_0-1676474155876.png

 

In the upper graph, the measure has the DAX as COUNT(Table[Column]).

 

Let me know if this works for you 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

serpiva64
Solution Sage
Solution Sage

Hi,

try 

SalesAmount2017 = CALCULATE(Sales[Sales Amount], 'Date'[Year]=2017)
and so on for other years
If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

Thankyou Worked a treat 🙂

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
Top Kudoed Authors