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
Kmcdonald
Helper III
Helper III

Using Different Date to Decide Status

Hi,

 

I'm trying to figure out how to use two different dates to capture two different statuses: 'Open' and 'Closed'.

So with my date in the field "Start Date" is when the event was open and the date in "Event Disposition Date (All)" is the date it closed.

 

I had a similar problem last week, which I got a solution for, but had to create a date table to link the date fields to and now I can't figure out this issue again.

 

So created a table with the formula below and linked this field with the two fields mentioned above.

QE Date = CALENDAR(DATE(2021,01,01),DATE(2050,12,31))
 
Below is the chart that comes out:
Kmcdonald_0-1646603095517.png

Each column is the total for each month, what I'm wanting though is to have it split out into 'Open' and 'Closed' dates. For example all the events in May 2021, I want to be in two columns for that month showing the number opened in the month (the "start date" field) and the number closed (the "Event Disposition Date (All)" field). So as well as the stacked data, seperated out clearly into the two conditions.

 

Last time around I was using the events' status, then took off label concantenate which gave this snapshot but it isn't the data I'm after.

Does anyone know how to show what I'm asking?

 
1 ACCEPTED SOLUTION
Kmcdonald
Helper III
Helper III

@v-henryk-mstf  and @AllisonKennedy  thanks for you help and I figured it out 🙂

I just unpivoted the date columns and wrote a quick conditional column that created the needed status to put both data fields onto the shared axis.

View solution in original post

11 REPLIES 11
Kmcdonald
Helper III
Helper III

@v-henryk-mstf  and @AllisonKennedy  thanks for you help and I figured it out 🙂

I just unpivoted the date columns and wrote a quick conditional column that created the needed status to put both data fields onto the shared axis.

Kmcdonald
Helper III
Helper III

v-henryk-mstf
Community Support
Community Support

Hi @Kmcdonald ,

 

You can upload attachments by other means, and then just provide a link to the shared file on the forum.


Looking forward to your reply.


Best Regards,
Henry

 

Kmcdonald
Helper III
Helper III

@v-henryk-mstf  I love to attach the file but there isn't any options to do so in the forum...

@Kmcdonald  You can use Onedrive link to share files, or just past a small table directly in the post so we can copy. Screenshots of what isn't working like you've been sending are helpful too. I managed to dig up my clustered stacked bar chart. Hope it helps. 

 

Here's the source data to save into csv if you want to edit it: 

 

Account Manager CY A CY B PY A PY B CY Total PY Total
Territory 1 800000 2300000 1000000 3000000 3100000 5300000
Territory 2 400000 3000000 800000 4000000 3400000 7000000
Territory 3 180000 3000000 300000 2000000 3180000 5000000
Territory 4 150000 1600000 300000 2000000 1750000 3600000
Territory 5 150000 1600000 300000 2000000 1750000 3600000
Territory 6 150000 1400000 300000 1000000 1550000 2400000
Territory 7 80000 1400000 300000 1500000 1480000 2900000
Territory 8 10000 100000 100000 1200000 110000 1300000
Territory 9 10000 100000 200000 600000 110000 700000
Territory 10 10000 0 50000 0 10000 0
Territory 11 0 0 0 0 0 0
Territory 12 0 400000 0 600000 400000 1000000
Territory 13 0 400000 0 600000 400000 1000000
Territory 14 0 150000 0 200000 150000 350000

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

v-henryk-mstf
Community Support
Community Support

Hi @Kmcdonald ,

 

Whether the advice given by @AllisonKennedy  has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly.

 

If not, can you provide some test data so that I can answer for you.


Looking forward to your feedback.


Best Regards,
Henry

Kmcdonald
Helper III
Helper III

@AllisonKennedy  have you got any links to give a run down on how to use these custom visuals?

 

They look quite complex from first glance and trying to figure out.

@Kmcdonald  they're not straightforward. Might take at least a few days to a week to learn how to use them. I've done a stacked clustered column with Charticulator before. If I get time I may do a blog on how I did it. 

 

In the meantime, try these links: 

https://www.burningsuit.co.uk/charticulator-in-power-bi-1/

 

This is a DAX solution, so no Charticulator needed. I haven't looked at it in great detail so not sure how good it is, but you'll need to truly understand the concepts to apply it to your scenario as you're doing something a bit different: 

https://www.youtube.com/watch?v=vuELVStfYck 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

AllisonKennedy
Super User
Super User

@Kmcdonald  You're on the right track and definitely need a date table. Create an inactive relationship between Event Disposition Date (All) and the Date column from your Calendar table.

 

Then create two measures to put in your chart:

 

Count Open = Countrows(table)

 

Count Closed = CALCULATE( COUNTROWS(table), USERELATIONSHIP( calendar[date], table[Event Disposition Date (All)] ) )

 

 

Now if you want to split this by classification also, you'll have to do it as a drill down or be a bit more creative. Hope that makes sense?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Thanks @AllisonKennedy , I created those measures but I can't get them into the shared axis of the chart?

The measure is formatted as a whole number but I can't move onto anything but the lines values or take over one of the column fields. That's unless there is something else I'm missing...

Kmcdonald_0-1646683957408.png

 

@Kmcdonald because they are measures, they can only go in Values. You could put classification in the shared axis and move them into the column values once the legend is empty, then drill down, but this won't give you the stacking you're looking for. 

 

A custom visual like Charticulator or Deneb is the only way I know to create a clustered stacked column chart.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.