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

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

Reply
Eryka90
Frequent Visitor

How to create a stacked bar chart with different categories and monitor with date

Hi All,

 

I would like to create stacked chart to monitor my due date status (Today Due, Not Due, Pass Due). Here is sample of my data

 

PO NumberNet Due Date
SL07868581INV11/18/2023
SL13421911/28/2023
SLI-4009453011/21/2023
SLI4022384411/5/2023
SLI4022391011/6/2023
SLI4022425811/13/2023
SLI4022447011/18/2023
SLI4022454311/19/2023
SLI4022460011/15/2023
SLI4022460211/20/2023
SLI4102066111/1/2023
SLI4102164511/30/2023
SLI4102917311/9/2023
SLI4102943611/30/2023
SLI4181850711/12/2023
SLI4181898511/13/2023

 

I did create a DAX for the status as below

New_Due Status =
IF(ISBLANK('Pending Items'[Net Due Date]), "Due Date Blank",
    IF('Pending Items'[Net Due Date] > TODAY(), "Not Due",
        IF('Pending Items'[Net Due Date] < TODAY(), "Past Due", "Due Today")
    )
)
However my chart showing like this
Eryka90_0-1700031344964.png

 

I'm looking is there a way to create stacked chart as below

Eryka90_1-1700031520893.png

Thank you for your help

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @Eryka90 

Assuming I understand correctly, the goal is to display the number of invoices in the system for each day, categorized by status.

In addition to the classification column you added, you need to calculate the cumulative quantity.

Since your data for today is all in the same status because 2023 is all before today, I have changed the data to illustrate the solution.

Ritaf1983_0-1713517944542.png

The first step is the date table :

Ritaf1983_1-1713518006085.png

Ritaf1983_2-1713518045379.png

Ritaf1983_3-1713518065585.png

Then I created a measure :

count_invoices =
VAR LastVisibleDate =
    MAX ( 'dim_date'[Date] )
VAR FirstVisibleDate =
    MIN ( 'dim_date'[Date] )
VAR LastDateWithSales =
    CALCULATE (
        MAX ( 'Table'[Net Due Date] ),
        REMOVEFILTERS ()  
    )
VAR Result =
    IF (
        FirstVisibleDate <= LastDateWithSales,
        CALCULATE (
           COUNTROWS('Table'),
            'dim_date'[Date] <= LastVisibleDate
        )
    )
RETURN
    Result
Ritaf1983_4-1713518126951.png

the last step is to put all the data in the desired graph :

Ritaf1983_5-1713518237073.png

The pbix is attached you can follow my steps

More information about the date table is here :

https://radacad.com/all-in-one-script-to-create-calendar-table-or-date-dimension-using-dax-in-power-...

Running totals here :

https://www.daxpatterns.com/cumulative-total/

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

1 REPLY 1
Ritaf1983
Super User
Super User

Hi @Eryka90 

Assuming I understand correctly, the goal is to display the number of invoices in the system for each day, categorized by status.

In addition to the classification column you added, you need to calculate the cumulative quantity.

Since your data for today is all in the same status because 2023 is all before today, I have changed the data to illustrate the solution.

Ritaf1983_0-1713517944542.png

The first step is the date table :

Ritaf1983_1-1713518006085.png

Ritaf1983_2-1713518045379.png

Ritaf1983_3-1713518065585.png

Then I created a measure :

count_invoices =
VAR LastVisibleDate =
    MAX ( 'dim_date'[Date] )
VAR FirstVisibleDate =
    MIN ( 'dim_date'[Date] )
VAR LastDateWithSales =
    CALCULATE (
        MAX ( 'Table'[Net Due Date] ),
        REMOVEFILTERS ()  
    )
VAR Result =
    IF (
        FirstVisibleDate <= LastDateWithSales,
        CALCULATE (
           COUNTROWS('Table'),
            'dim_date'[Date] <= LastVisibleDate
        )
    )
RETURN
    Result
Ritaf1983_4-1713518126951.png

the last step is to put all the data in the desired graph :

Ritaf1983_5-1713518237073.png

The pbix is attached you can follow my steps

More information about the date table is here :

https://radacad.com/all-in-one-script-to-create-calendar-table-or-date-dimension-using-dax-in-power-...

Running totals here :

https://www.daxpatterns.com/cumulative-total/

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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
Top Kudoed Authors