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
Raman3456
Helper II
Helper II

Dynamic Calculated Column Name based on Year Values

Hello Everyone,

 

Name      2021 Count     2022 count         2025 Count

A                 13

B                  3

C                  9

D                  7

 

I have this data I need to add calculated columns Dynamically -- 2021 count, 2022 count .... 2025 count on every year .

 

Will it be possible in Power BI?

 

Regards,

Raman PC

 

2 ACCEPTED SOLUTIONS
DataNinja777
Super User
Super User

Hi @Raman3456 ,

 

Yes. It is easily doable in Power BI.  

Create a Calendar table using CALENDAR and link it to your data table by year. Use a Matrix visual with Name in Rows, Year from the Calendar table in Columns, and your Count in Values for a dynamic, scalable solution.

Best regards,

View solution in original post

Anonymous
Not applicable

Thanks for the reply from DataNinja777 , please allow me to provide another insight: 
Hi  @Raman3456 ,

 

Here are the steps you can follow:

1. In Power Query – Add Column – Date – Year -- Year.

vyangliumsft_0-1736146139210.png

2. Select [Year] – Tramsform – Pivot Column.

Values Column – [Date]

Aggregate Value Function – Count(ALL)

vyangliumsft_1-1736146139214.png

3. Result:

vyangliumsft_2-1736146179044.png

 

Best Regards,

Liu Yang

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

2 REPLIES 2
Anonymous
Not applicable

Thanks for the reply from DataNinja777 , please allow me to provide another insight: 
Hi  @Raman3456 ,

 

Here are the steps you can follow:

1. In Power Query – Add Column – Date – Year -- Year.

vyangliumsft_0-1736146139210.png

2. Select [Year] – Tramsform – Pivot Column.

Values Column – [Date]

Aggregate Value Function – Count(ALL)

vyangliumsft_1-1736146139214.png

3. Result:

vyangliumsft_2-1736146179044.png

 

Best Regards,

Liu Yang

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

DataNinja777
Super User
Super User

Hi @Raman3456 ,

 

Yes. It is easily doable in Power BI.  

Create a Calendar table using CALENDAR and link it to your data table by year. Use a Matrix visual with Name in Rows, Year from the Calendar table in Columns, and your Count in Values for a dynamic, scalable solution.

Best regards,

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.