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
MissLilly
New Member

How to create query

I am new to PowerBi and am struggling to create a simple query. I've created a two new columns as I want one to show a count of the 2023 and 2024 year from the column below, and the other column to show the a count of the remaining years in the column. But I just can't get the queries right, can anyone help please? 

MissLilly_0-1716963390297.png

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @MissLilly ,

 

To do this in Power Query, you can select your [Next Review Date] column, go to the Home tab > Group By (or right-click on the column header and find 'Group By...'. The aggregation column should default to the Count operator which is fine. Hit OK and you'll have your years with a count of rows next to them.

 

However, depending on your exact scenario, this probably isn't something that should be done in Power Query. Calculating counts/averages/sums etc should really be done with DAX in Power BI (after applying your Power Query to the data model).

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

1 REPLY 1
BA_Pete
Super User
Super User

Hi @MissLilly ,

 

To do this in Power Query, you can select your [Next Review Date] column, go to the Home tab > Group By (or right-click on the column header and find 'Group By...'. The aggregation column should default to the Count operator which is fine. Hit OK and you'll have your years with a count of rows next to them.

 

However, depending on your exact scenario, this probably isn't something that should be done in Power Query. Calculating counts/averages/sums etc should really be done with DAX in Power BI (after applying your Power Query to the data model).

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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