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
mtibbert
Frequent Visitor

include value in all axis categories that are less than that value

I have a dataset with a PartNumber and WeekNumber column. I have a line chart with WeekNumber as the axis and count of part number as the value. I need this row to be included in all x-axis categories that are less than that WeekNumber.

 

This is a Raw Material Burndown chart. The WeekNumber is the week in which that part will be delivered to us by a supplier. So for example, if that row(part) has a WeekNumber of 6, the supplier has committed to delivering that part to us in week 6. The value for that row(1 because it is a count) should be a part of all x-axis categories prior to week 6, Because it will be owed to us in weeks 1-6. Then on week 7, it will have been delivered to us and will no longer need to be a part of the count for that week.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@mtibbert 

I guess you should have -1 at the end since you want it to be count until the week before the current week. 


Count = CALCULATE (COUNTROWS (FILTER ( ALL ( Table ), Table[WeekNum] <= MAX ( PartTable[WeekNum] ) -1 )))

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@mtibbert 

I guess you should have -1 at the end since you want it to be count until the week before the current week. 


Count = CALCULATE (COUNTROWS (FILTER ( ALL ( Table ), Table[WeekNum] <= MAX ( PartTable[WeekNum] ) -1 )))

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

TLDR; I just summarized my data within SQL before exporting the csv.

 

While this did work and produced a chart, It was ultimately not chart I was looking for.

 

After pondering for a while, I actually needed to sum a quantity column for each week where the parts supply date was in the future and the demand date was in the past. effectively telling me how many parts are due THAT week instead of due after that week. a brain teaser.

 

dedelman_clng
Community Champion
Community Champion

Hi @mtibbert -

 

You will want something like this as the measure to use as the value for your chart

 

Owed Count =
CALCULATE (
    COUNTROWS (
        FILTER ( ALL ( PartTable ), PartTable[WeekNum] <= MAX ( PartTable[WeekNum] ) )
    )
)

 

If this doesn't work, please share sample data and expected results (in a manner that can be copy/pasted in Excel, so not a screenshot), or a sample report with sensitive data removed.

 

Hope this helps

David

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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