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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jellyjoe
Helper I
Helper I

Count of values by date

Hey guys, I've ran into an issue when trying to make a chart visualising how many ,,statuses" have been achieved in relation to date.

Here's how my tables look like

,,Planned schedule" table: https://gyazo.com/6a1ae11cb8782c35fb4b6643041046c9

,,Actual schedule" table: https://gyazo.com/c25038d117c8e35a90b075e513daf649

empty records in ,,actual" table mean a status hasn't been achieved yet.

The chart im trying to get is one showing a sum of a certain status achieved by date (for example how many ,,installation" status were achieved by 08.11.2020)

Example of what i'm trying to achieve:

https://gyazo.com/43aab2d9ea655754acdc7a0d077d3155

And if its possible i'd like to then compare it to the plans:

https://gyazo.com/8e74808990d2fbb2155b86f60d37963e

 

How would you guys approach that problem?

6 REPLIES 6
jellyjoe
Helper I
Helper I

For some reason i can't edit the previous message, anyways. Here's the proper ,,actual" table because i sent the same one two times:

LineOP No.MC No.PlannedArrival
1a1Planned03.11.2020
1b4Planned03.11.2020
1c5Planned03.11.2020
1d7Planned03.11.2020
1e8Planned03.11.2020
1f9Planned03.11.2020
1g10Planned03.11.2020
1h11Planned04.11.2020
150B14Planned04.11.2020

 

1i12Planned04.11.2020
1j15Planned04.11.2020
1k16Planned04.11.2020
1l17Planned04.11.2020
1m13Planned04.11.2020
1n18Planned04.11.2020
1o19Planned05.11.2020
1p6Planned05.11.2020
1r20Planned06.11.2020
1s21Planned06.11.2020

 

1t3Planned06.11.2020
1y2Planned07.11.2020

 

In 3 parts because the forum doesn't allow me to send it  otherwise

Anonymous
Not applicable

Hi @jellyjoe ,

Could you please provide specific calculation logic and final results based on the sample data you gave? Not sure how to calculate the number of machine with arrived status? Is it equal to the number of machines on the corresponding date in Schedule Actual table? Or is it to compare Schedule Actual table with the Schedule pLAN table to get the number of machines on that day? Thank you.

Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.

jellyjoe
Helper I
Helper I

 

Sorry for the late answer @Anonymous .
Here's the data in tables:

,,Actual" Table:

LineOP No.MC No.PlannedArrivalUnpacking
1a1Planned03.11.202003.11.2020
1b4Planned03.11.202003.11.2020
1c5Planned03.11.202003.11.2020
1d7Planned03.11.202003.11.2020
1e8Planned03.11.202004.11.2020
1f9Planned03.11.202004.11.2020
1g10Planned03.11.202004.11.2020
1h11Planned04.11.202004.11.2020
150B14Planned04.11.202004.11.2020
1i12Planned04.11.202005.11.2020
1j15Planned04.11.202005.11.2020
1k16Planned04.11.202005.11.2020
1l17Planned04.11.202005.11.2020
1m13Planned04.11.202006.11.2020
1n18Planned04.11.202006.11.2020
1o19Planned05.11.202006.11.2020
1p6Planned05.11.202006.11.2020
1r20Planned06.11.202006.11.2020
1s21Planned06.11.202007.11.2020
1t3Planned06.11.202007.11.2020
1y2Planned07.11.202007.11.2020

And the ,,Planned" table

LineOP No.MC No.PlannedArrivalUnpacking
1a1Planned03.11.202003.11.2020
1b4Planned03.11.202003.11.2020
1c5Planned03.11.202003.11.2020
1d7Planned03.11.202003.11.2020
1e8Planned03.11.202004.11.2020
1f9Planned03.11.202004.11.2020
1g10Planned03.11.202004.11.2020
1h11Planned04.11.202004.11.2020
150B14Planned04.11.202004.11.2020
1i12Planned04.11.202005.11.2020
1j15Planned04.11.202005.11.2020
1k16Planned04.11.202005.11.2020
1l17Planned04.11.202005.11.2020
1m13Planned04.11.202006.11.2020
1n18Planned04.11.202006.11.2020
1o19Planned05.11.202006.11.2020
1p6Planned05.11.202006.11.2020
1r20Planned06.11.202006.11.2020
1s21Planned06.11.202007.11.2020
1t3Planned06.11.202007.11.2020
1y2Planned07.11.202007.11.2020

 

The goal is to calculate the sum of how many machines achieved for example the ,,Arrival" state by a certain date, and compare it to how many machines were planned to achieve the state by that day.

So for example:

Lets say that on

01/01/2020 - 3 machines achieved state Arrival

02/01/2020 - 4 other machines achieved state Arrival

03/01/2020 - 2 other machines achieved state Arrival

I want the line chart to show me a value of 4 on 01/01/2020, then a value of  (3+4) = 7 on 02/01/2020, and then a value of (7+2) = 9 on 03/01/2020.

And the same would go for the ,,planned" table so that i could compare that for example on day X/X/2020 12 machines achieved state Y and the plans were to achieve for example 15.

jellyjoe
Helper I
Helper I

Thanks for your answer @Anonymous ,

It semi-works however im still having trouble achieving a certain effect that i wanted to get from the line chart.
Currently it shows the count of achieved statuses for each day separately. 
https://gyazo.com/c26b093d1461b15e953ec7ea429ac2eb
What i want to achieve is the aggregated values for each day. Something like this:
https://gyazo.com/b93aa078b57ab4e0cc0f5aa0c62d295c

Anonymous
Not applicable

Hi @jellyjoe ,

What's the meaning of the aggregated values for each day? It equals to count of actual status plus count of planned status? Could you please provide some sample data with text format and desired result with calculation logic? Thank you.

In addition, please create the below measure and drag this measure onto your line chart to replace the original Values fields. Later check whether you can get the desired result.

Measure =
VAR _curdate =
    SELECTEDVALUE ( 'Date'[Date] )
VAR _actual =
    CALCULATE (
        COUNT ( 'Actual schedule'[Planned] ),
        FILTER ( 'Actual schedule', 'Actual schedule'[Installation] = _curdate )
    )
VAR _palnned =
    CALCULATE (
        COUNT ( 'Planned schedule'[Planned] ),
        FILTER ( 'Planned schedule', 'Planned schedule'[Installation] = _curdate )
    )
RETURN
    _actual + _palnned

Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.

Anonymous
Not applicable

Hi @jellyjoe ,

First, you need to create a date dimension table and create relationships with Actual schedule and Planned schedule table base on date field as below screenshot:

create date dimension table and relationships.JPG

Then create a line chart (Axis: Date field in Date table   Values: count of Actual  and count of Planned)

line chart.jpg

Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.

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