Forum Discussion
Compare in a bar graph
- 6 years ago
Hi JohnnyWind ,
You will need a separate calendar table in your data model, this is where you will get the [Month] field from for your chart axis. The easiest way to achieve this is to create a new table in the Data view and paste the following in the formula bar:
Calendar = ADDCOLUMNS( CALENDARAUTO(), "Month", FORMAT([Date], "mmm") )Once you have that, you can create relationships as follows:
1) Calendar[Date] (one) to YourTable[Created Date] (many) - ACTIVE relationship
2) Calendar[Date] (one) to YourTable[Closed Date] (many) - INACTIVE relationship
You would then create the following measures:
_noofCreated = DISTINCTCOUNT(aTable[Incident ID]) _noofClosed = CALCULATE( DISTINCTCOUNT(aTable[Incident ID]), USERELATIONSHIP(aTable[Closed date], Calendar[Date]) )Notice that the _noofClosed measure is different in that it uses CALCULATE and USERELATIONSHIP - this forces Power BI to use your inactive relationship between the calendar table and your table for that measure.
This give me the following output:
Pete
- 6 years ago
Hi, JohnnyWind
As mentioned by BA_Pete ,you can create a INACTIVE relationship.
I make a sample file.Hope it can help you ,If it doesn't meet your requirement, please share more details.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Rogletree,
The problem is that I have to month columns, one with open date and the other one with the closing date.
Best regards,
Hi, JohnnyWind
As mentioned by BA_Pete ,you can create a INACTIVE relationship.
I make a sample file.Hope it can help you ,If it doesn't meet your requirement, please share more details.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.