Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Create A Stacked Column Chart that Shows Monthly Counts

I have a simple table of data that shows an "Issue_#" and three dates for each row. All I want to be able to do is create a stacked column chart that will show the number of "Issue_#"s that were "Rai...
  • Ritaf1983's avatar
    3 years ago

     Hi Anonymous 
    You can achieve it with disonacted date table and 3 dax dormulas for evrery "status":

     

    1. 

    StartedCount =
    var start_ = min('Calendar'[Date])
    var end_ =max('Calendar'[Date])
    var starteD_count = CALCULATE(DISTINCTCOUNT('Table'[Issue]),
    'Table'[started]>=start_ && 'Table'[started]<=end_)
    return starteD_count
    2.
    RaisedCount =
    var start_ = min('Calendar'[Date])
    var end_ =max('Calendar'[Date])
    var Rased_count = CALCULATE(DISTINCTCOUNT('Table'[Issue]),
    'Table'[Raised]>=start_ && 'Table'[Raised]<=end_)
    return Rased_count
    3.
    CompletedCount =
    var start_ = min('Calendar'[Date])
    var end_ =max('Calendar'[Date])
    var _count = CALCULATE(DISTINCTCOUNT('Table'[Completed]),
    'Table'[Completed]>=start_ && 'Table'[Completed]<=end_)
    return _count
    Result :

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



  • Ritaf1983's avatar
    Ritaf1983
    3 years ago

    Hello, I didn't quite understand the format of the date you displayed.
    In general, you should create a numeric column that allows you to sort the column you use on your graph from the calendar table.
    Here is an example from my answer in another discussion, you should use the same logic, refer to your format:
    https://community.fabric.microsoft.com/t5/Desktop/Trend-lines-Month-Name-by-year-are-not-in-ascending-order/m-p/3140555

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