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
bice_cold
Frequent Visitor

Cumulative total plot with empty values

I'm using a measure to create a plot of cumulative total employees at our company by department. It looks like this:

 

EhKVwLQxNv.png

 

The measure looks like this:

 

Running Total =

CALCULATE (
SUMX(Employee_Table, Employee_Table[Count]),
    FILTER (
        ALL( 'Employee_Table' ),
        'Employee_Table'[Date] <= MAX( 'Date'[Date] )),
    VALUES(Employee_Table[Department])
)
 
Employee_Table is a table of employee ID#, name, manager, location, hire date, and termination date. On their hire date record they have a count of +1 and on their termination date they have a count of -1. The date table is a calculated table using the min(date) from employee table as the start date and today() as the ending date.
 
This seems to calculate fine, but the problem I run into is that when I plot this all out, if a department doesn't hire in a month the running total doesn't contribute to the given bar. So for example, recruiting is grey in this plot and in the last 4 bars (months) has a value of 9, 10, 0, and 10 because in the second to last month they didn't hire anyone. It should visualize as 9, 10, 10, 10. Also, if this works the stacked column at the very end should have a total of 532, which it does in the tooltip but not the visualization.
 
Thanks for your help!
2 REPLIES 2
Mobashar_Shah
Frequent Visitor

Hi all, 

 

i have the same problem, and no idea how to fix it. 

 

so i have a cumulative bar chart which is working fine and i can not get the bars with no change to show up for the previous quarters. 

 

any help would be appreciated. 

 

my cumulative DAX formula read as

 

Cumulative = CALCULATE(COUNT('History: Risk'[Id]),FILTER(ALL('History: Risk'[CreatedDate].[Date]),'History: Risk'[CreatedDate].[Date] <= MAX('History: Risk'[CreatedDate])))

 

Capture.PNG

v-shex-msft
Community Support
Community Support

HI @bice_cold,

 

I think this should related to values function, when specific department not contain in current date range, it will hide rolling cumulative total amount.

 

Can you please share some sample data for test to coding formula?

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help 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.