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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

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 "Raised", "Started" and "Completed" each Year and Month with the respective breakdowns.

 

I have tried building a calendar table and making the relatioships, but nothing I seem to do gives me the right information. Can someone provide a simple step by step explanation to what I need to do to make this work?

 

mkusler_0-1685732551543.png

 

 

 

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

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

Ritaf1983_0-1685784941202.png

 

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 :
Ritaf1983_1-1685785084304.png

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



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

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-ascendin...

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

5 REPLIES 5
Anonymous
Not applicable

@Ritaf1983 Thank you again! That was a simple solution. I didn't even think of adding in a sort column. All is good now!

I was happy to assist 🙂

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

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

Ritaf1983_0-1685784941202.png

 

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 :
Ritaf1983_1-1685785084304.png

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



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

That worked! Thank you!

 

One more question.....I can't seem to get my visual to sort the year/month correctly, and also there is another "0" being added after each year. Do you know how to fix this? I have tried changing the sort criteria, but it's always jumbled. 

 

mkusler_0-1685803942573.png

 

Is there something wrong with my calendar table setup for "Year Month Number"?

 

mkusler_1-1685804047645.png

 

 

Thanks again!

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-ascendin...

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.