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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
CMaxwell
New Member

Summarizing total days where a specific count of vehicles are needed

Hello,

 

I posted on this topic previously but was not able to include the data set due to the size and complexity.  I want to try this again but in a simpler form.  I am trying to show the total number of days from a date range where a specifc total of vehicles are needed.  Here is the dataset I am working with.  The column chart is what I am trying to create in Power BI where I summarize the vehicle count for each individual date, and then summarize the number of days where a sp

ecific vehicle count is needed (1-5 vehicles).  I was able to create the visual in excel by using a pivot table, but I want to set this up in Power BI to make updating easier. 

 

I'm still learning Power BI and guessing a measure is needed, but not sure how to do that.  Is there a simple way to summarize and visualize the data and generate the chart below?

 

Drive IDDrive Date Vehicle Need
11/1/2024 1
21/1/2024 1
31/1/2024 1
41/2/2024 2
51/2/2024 1
61/3/2024 1
71/3/2024 1
81/3/2024 1
91/3/2024 1
101/4/2024 1
111/4/2024 2
121/4/2024 1
131/5/2024 2
141/8/2024 1
151/8/2024 1
161/9/2024 2
171/9/2024 2
181/9/2024 1
191/10/2024 1
201/10/2024 2
211/10/2024 1
221/11/2024 3
231/12/2024 1
241/12/2024 1
251/12/2024 1
261/12/2024 1
271/14/2024 1
281/15/2024 1
291/16/2024 2
301/16/2024 1
311/16/2024 1
311/17/2024 5

 

CMaxwell_0-1729798558786.png

 

 

 

1 ACCEPTED SOLUTION

The other option is create a list of numbers to represent number of cars.

Either using Enter Data or GenerateSeries.

Use this in you visauls with this measure:

SamWiseOwl_0-1729800682932.png

Car Days Measure =
var curr = SELECTEDVALUE('Total needed Table'[Number needed]) --capture current column number of cars needed.

RETURN
COUNTROWS(--count the number of rows
    Filter( --filter to current column nummber
        SUMMARIZE(--group the table by date, sum number of cars needed
                    all('Car Table'), 'Car Table'[Drive Date], "New", SUM('Car Table'[Vehicle Need]))
                    ,[New] = curr))

If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @CMaxwell ,

 

Hello! I wanted to check if your issue has been resolved. I noticed that @SamWiseOwl  has provided two excellent solutions. If either of these has addressed your concern, please consider marking it as the accepted solution, as this can be immensely helpful for others facing similar challenges. However, if the problem is still unresolved, please let us know—we’ll be glad to assist further.

 

Best Regards,
Bof

SamWiseOwl
Super User
Super User

Hi @CMaxwell 

The easiest method would be using the query editor.

Right click the date column and choose Group By and then Sum the Cars needed column:

SamWiseOwl_0-1729799719228.png

SamWiseOwl_1-1729799915610.png

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

The other option is create a list of numbers to represent number of cars.

Either using Enter Data or GenerateSeries.

Use this in you visauls with this measure:

SamWiseOwl_0-1729800682932.png

Car Days Measure =
var curr = SELECTEDVALUE('Total needed Table'[Number needed]) --capture current column number of cars needed.

RETURN
COUNTROWS(--count the number of rows
    Filter( --filter to current column nummber
        SUMMARIZE(--group the table by date, sum number of cars needed
                    all('Car Table'), 'Car Table'[Drive Date], "New", SUM('Car Table'[Vehicle Need]))
                    ,[New] = curr))

If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors