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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
DidacBF
Frequent Visitor

Missing values in cumulative count when filtering by month

Hi, I made this basic measure to cumulative SUM a value over the months:

PHs PLV Colocado Acumulado =

CALCULATE (
    DISTINCTCOUNTNOBLANK(PDV[ID pdv]),
    'Respuestas - PLV'[Colocado]=1,
    FILTER (
        ALL ( Calendario[Fecha visita] ),
        Calendario[Fecha visita] <= MAX ( ( Calendario[Fecha visita] ) )
    )
)
It is working when I use it on a matrix with months:
DidacBF_0-1665167285691.png


But when I filter by month, both items with no data that month disappear:

DidacBF_1-1665167355791.png


I think I'm missing something obvious but I can't make it work...

Thank you!!!

1 ACCEPTED SOLUTION
DidacBF
Frequent Visitor

Hello @Greg_Deckler !

Thank you for the reply but I might not explained myself.

With your solution it shows the categories but with a 0 as value, what i was expecting is the running total value even when the month has no data for that category:

DidacBF_0-1665326034673.png


This is what I want when I filter by month:

DidacBF_1-1665326135361.png


Thank you!!



I ended up making it work by creating a calculated table with summarizecolumns (month and category) and +0 for months with no data, and then a measure over it with MAX since the value will never decrease.
Not 100% happy because I'm pretty sure it's a better way of doing this but at least I got it working.

Thank you!!

View solution in original post

2 REPLIES 2
DidacBF
Frequent Visitor

Hello @Greg_Deckler !

Thank you for the reply but I might not explained myself.

With your solution it shows the categories but with a 0 as value, what i was expecting is the running total value even when the month has no data for that category:

DidacBF_0-1665326034673.png


This is what I want when I filter by month:

DidacBF_1-1665326135361.png


Thank you!!



I ended up making it work by creating a calculated table with summarizecolumns (month and category) and +0 for months with no data, and then a measure over it with MAX since the value will never decrease.
Not 100% happy because I'm pretty sure it's a better way of doing this but at least I got it working.

Thank you!!

Greg_Deckler
Super User
Super User

@DidacBF Try:

CALCULATE (
    DISTINCTCOUNTNOBLANK(PDV[ID pdv]),
    'Respuestas - PLV'[Colocado]=1,
    FILTER (
        ALL ( Calendario[Fecha visita] ),
        Calendario[Fecha visita] <= MAX ( ( Calendario[Fecha visita] ) )
    )
) + 0


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.