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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Running total vs blank dates in vs calendar

Hi,

 

i'm having troubles with following issue. I need to report by time how many of salesmen is eligbile (that means he's got more than YYY $$ sales per day). The table below shows data for 1 salesman. I wanna build a area chart based on "If eligible" measure for all salesmen.

 

KK idCampaignDataRunning totalIf eligible
xxxxxxxx 18.10.2018 0
xxxxxxxx 19.10.2018 0
xxxxxxxx 20.10.2018 0
xxxxxxxx20181521.10.2018331.381
xxxxxxxx20181522.10.2018411.341
xxxxxxxx 23.10.2018 0
xxxxxxxx 24.10.2018 0
xxxxxxxx 25.10.2018 0
xxxxxxxx20181526.10.2018579.281
xxxxxxxx 27.10.2018 0

 

The point is - my measure doesn't work with blank dates. I mean there are:

1. Calendar with dates

2. Invoices with sales

 

When there is no invoice for particular date my running total is blank.

 

The measure looks like this:

 

Running total sales measure test =

CALCULATE (
SUM('Sales & Prizes'[sls]);
FILTER (
ALL('Calendar');
'Calendar'[Data] <= MAX('Sales & Prizes'[day])
&&
'Calendar'[Campaign long] = SELECTEDVALUE('Sales & Prizes'[Campaign]) 
))

 

 



I would be very grateful for your help...!!

 

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

Please download the demo from the attachment. The measure works. The relationship should be "single filter".

Running total sales measure test =
CALCULATE (
    SUM ( 'Sales & Prizes'[Running Total] ),
    FILTER (
        ALL ( 'Calendar'[Date] ),
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
    )
)

Running-total-vs-blank-dates-in-vs-calendar

 

 

Best Regards,
Dale

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

View solution in original post

5 REPLIES 5
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Could you please mark the proper answers as solutions?

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@Dale,

 

I'm still working on it. I will mark answers and respond as soon as I solve problems and will show you my solution.

 

Best regards

 

Update:

 

I marked the solution. The key was changing "ALL ( 'Calendar' )" into "ALL ( 'Calendar'[Date] )". Really appreciate!

v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Everything seems good. Try this one, please. The dates in the visual should be from the 'Calendar' table.

 

Running total sales measure test =
CALCULATE (
    SUM ( 'Sales & Prizes'[sls] );
    FILTER (
        ALL ( 'Calendar' );
        'Calendar'[Data] <= MAX ( 'Calendar'[Data] )
            && 'Calendar'[Campaign long] = SELECTEDVALUE ( 'Sales & Prizes'[Campaign] )
    )
)

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @Dale,

 

I really much appreciate your help!

 

..but it still doesn't work properly...


Salesman.Salesman IDCalendar.SalesCampaignCalendar.DateRunning total sales measure

XXXX20181521.10.2018 00:00331
XXXX20181522.10.2018 00:00411
XXXX20181526.10.2018 00:00

579

 

If I tick "Show items with no data" on table visual I get:

 

Salesman.Salesman IDCalendar.SalesCampaignCalendar.DateRunning total sales measure

XXXX20181518.10.2018 00:00 
XXXX20181519.10.2018 00:00 
XXXX20181520.10.2018 00:00 
XXXX20181521.10.2018 00:00331
XXXX20181522.10.2018 00:00411
XXXX20181523.10.2018 00:00 
XXXX20181524.10.2018 00:00 
XXXX20181525.10.2018 00:00 
XXXX20181526.10.2018 00:00579
XXXX20181527.10.2018 00:00 

 

I'm not a beginner in DAX & PowerBI, but I'm confused and frustrated a bit. I was also tryning to change my model relationships ("Both"/"Single" filtering)...

Hi @Anonymous,

 

Please download the demo from the attachment. The measure works. The relationship should be "single filter".

Running total sales measure test =
CALCULATE (
    SUM ( 'Sales & Prizes'[Running Total] ),
    FILTER (
        ALL ( 'Calendar'[Date] ),
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
    )
)

Running-total-vs-blank-dates-in-vs-calendar

 

 

Best Regards,
Dale

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors