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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
LewisH
Helper II
Helper II

Calculate Count Of Rows Per Month

We Have a Table ' Service Desk List' Whcih has two fields, "Requested Date" and "Resolved Date". How can I calculate how many of each are populated within each month.  I am aiming to use this in a Line Graph to show the difference. 

1 ACCEPTED SOLUTION
vanessafvg
Community Champion
Community Champion

@LewisH

 

 

are you wanting to plot different counts of resolved vs requests?

1.firstly you need a date table do you have one?

2.then you need to create a relationship between both of your  dates and the date table .  when you create these relationships one will be an active relationship (default), the other will be an inactive relationship.

3.  create a count measure for each of the date relationships.

 

For whichever is the active relationship assuming its the requested date

 

requests = countrows(table)

resolved = calculate(countrows(table), userelationship(table[resolveddate], datetable[date])

 

then you can drag your date onto the graph and your 2 measures.

 

might sound confusing if you haven't done this before

 

here are some links

https://www.mattmasson.com/2014/02/creating-a-date-dimension-with-a-power-query-script/

https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-create-and-manage-relationships/

 

 

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
vanessafvg
Community Champion
Community Champion

@LewisH

 

 

are you wanting to plot different counts of resolved vs requests?

1.firstly you need a date table do you have one?

2.then you need to create a relationship between both of your  dates and the date table .  when you create these relationships one will be an active relationship (default), the other will be an inactive relationship.

3.  create a count measure for each of the date relationships.

 

For whichever is the active relationship assuming its the requested date

 

requests = countrows(table)

resolved = calculate(countrows(table), userelationship(table[resolveddate], datetable[date])

 

then you can drag your date onto the graph and your 2 measures.

 

might sound confusing if you haven't done this before

 

here are some links

https://www.mattmasson.com/2014/02/creating-a-date-dimension-with-a-power-query-script/

https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-create-and-manage-relationships/

 

 

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




That has worked Excellently, thank you. 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.