Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hello All,
I need to create a line chart for below data with Time on Axis and NoOfPeople on Values:
Camera NoOfPeople Time ID Cam 1 10 10:10 AM 1 Cam 1 3 10:15 AM 2 Cam 1 44 10:20 AM 3 Cam 1 2 10:25 AM 4 Cam 1 3 10:30 AM 5 Cam 1 55 10:35 AM 6 Cam 1 4 10:40 AM 7 Cam 1 44 10:45 AM 8 Cam 1 33 10:50 AM 9
Problem Statement:
I have a line chart and a slicer in which Time is selected
If i choose 10:25 AM in my Time Slicer i should only see data plotted in Line Chart till 10:25 AM i.e. Last 5 entries are not plotted.
Similarily if choose 10:15 AM in my Time Slicer i should only see data plotted for 1st two entries and so on.
Can anybody suggest any trick for doing this?
Prateek Raina
Solved! Go to Solution.
Hi @prateekraina,
Based on my test, you should be able to follow steps below to get your expected result.
1. Add a new table with all possible Time value, and make sure there is no relationship between the two tables.
2. Use the formula below to create a new measure.
Measure =
CALCULATE (
SUM ( Table1[NoOfPeople] ),
FILTER ( Table1, Table1[Time] <= MAX ( Table2[Time] ) )
)
3. Then you should be able to show the Time column from your original table as Axis, and the measure as Value on Line Chart to get your expected result.
Here is the sample pbix file for your reference. ![]()
Regards
Hi @prateekraina,
Based on my test, you should be able to follow steps below to get your expected result.
1. Add a new table with all possible Time value, and make sure there is no relationship between the two tables.
2. Use the formula below to create a new measure.
Measure =
CALCULATE (
SUM ( Table1[NoOfPeople] ),
FILTER ( Table1, Table1[Time] <= MAX ( Table2[Time] ) )
)
3. Then you should be able to show the Time column from your original table as Axis, and the measure as Value on Line Chart to get your expected result.
Here is the sample pbix file for your reference. ![]()
Regards
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 76 | |
| 38 | |
| 31 | |
| 27 | |
| 26 |