DAX - How not to display future value in a chart when using running total ?

Vander1981

New Member
Joined
Jun 20, 2017
Messages
18
Hi,

I am stuck with a visualization problem.

I have got a running total measure that I want to display in a Quarterly Chart (Column chart) with a drill down by months.

I have a Sales Table with a column Date (Max Date is 01-07-2017 / 01-JULY-2017) and a calendar Table.

I am working with a Fiscal calendar : 1st month is APRIL

I tried to work around this with a SWITCH formula :

Code:
 Portfolio accounts 2017 RT% Qtr (PCI) =
SWITCH (
    TRUE;
    MAX ( 'Calendar'[Date] ) > MAX ( Sales[Date] ); BLANK ();
    [Portfolio accounts 2017 RT% (PCI)]
)

For a reason that I cannot understand it only displays Q1 and not Q2 ?

Any idea ? :)

Thanks a lot
 
Last edited:
Create two measures one each for the max calendar and sales dates. Drop them in your viz and you should soon see what is going on.
 
Upvote 0
Create two measures one each for the max calendar and sales dates. Drop them in your viz and you should soon see what is going on.

Now, I understand what's the problem.

Here is the solution I found :)

Code:
Portfolio accounts 2017 RT% Qtr (PCI) =
VAR MAXSALES =
    MAX ( Sales[Date] )
VAR MAXCALENDAR =
    CALCULATE ( MIN ( 'Calendar'[Date] ); 'Calendar'[Fiscal Year] = 2017 )
RETURN
    SWITCH (
        TRUE;
        MAXCALENDAR > MAXSALES; BLANK ();
        [Portfolio accounts 2017 RT% (PCI)]
    )
 
Last edited:
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top