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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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