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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
00Kevin00
Frequent Visitor

Running Total for product numbers by categories

Hello experts,

 

I hope someone can help me with my DAX formula.

 

I have the following situation: I wish to create a Measure which gives me the running total for a distinct count of my product numbers by their publishing year. For this, I created the following measure:

Running Total product number (Publishing Year) =
CALCULATE (
    DISTINCTCOUNT('Product'[Product number]),
    FILTER (
        ALL ( 'Product'[Publishing Year] ),
        'Product'[Publishing Year] <= MAX ( 'Product'[Publishing Year] )
    )
)

This measure works just fine, when no further level of detail is required. However, in combination with the use of categories (in my case a product brand clustering). The running total only extends to the last year in which a product is published. This leads to incorrect totals:

00Kevin00_0-1719411535668.png

 

E.g. The red part in 2028 would be 171 and not 0.

Currently, my DAX formula leads to this result in a table format:

 00Kevin00_3-1719411403273.png

What I would like to achieve is the following:

00Kevin00_4-1719411442470.png

Note: Publishing year is not a in separate date table but an integer value in the product table.

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please try something like below whether it suits your requirement.

 

 

Running Total product number (Publishing Year) =
COUNTROWS (
    SUMMARIZE (
        FILTER (
            ALL ( 'Product' ),
            'Product'[Product number] = MAX ( 'Product'[Product number] )
                && 'Product'[Publishing Year] <= MAX ( 'Product'[Publishing Year] )
        ),
        'Product'[Product number]
    )
)

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Unfortunately, this does not lead to the wished result. Below you can see the outcome with this DAX-formula:

00Kevin00_0-1719819393896.png

 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.