Forum Discussion

smerugu28's avatar
smerugu28
Regular Visitor
2 years ago
Solved

Bar chart on created vs resolved

Hi Team,   I have the below data and I want to show a single bar chart day-wise for created vs resolved incidents. Can someone guide me with it, please?   Number State Updated Created Chan...
  • Ashish_Mathur's avatar
    2 years ago

    Hi,

    In the Query Editor, remove the time stamp from Created and Resolved columns.  Create a Calendar Table.  Create an active relationship (Many to One and Single) from the Created column to the Date column and an inactive relationship (Many to One and Single) from the Resolved column to the Date column.  To your visual, drag Date from the Calendar Table.  Write these measures

    C = counta(Data[Number])

    R = calculate([c],userelationship(Data[Resolved],Calendar[date]))

    Hoep this helps.

  • Ritaf1983's avatar
    2 years ago

    Hi smerugu28 
    To get the desired result you must apply a few steps :
    From PQ you need to get date from date time format: 

    Then do the same with resolved date 

    From the mode view 

    Create a date table :

    for more information about the date table please refer :

    https://www.datacamp.com/tutorial/how-to-create-date-tables-in-power-bi-tutorial

    As you have a date table create 2 relationships, active to created date, inactive to resolved date

    Measures : 

    Create 2 measures :
    For created :

    created QTY = DISTINCTCOUNT('Table'[Number])
    For resolved :
    resolved qty = CALCULATE([created QTY],all('Table'[Created date]),USERELATIONSHIP('calendar'[Date],'Table'[Resolved Date]))
    More information about userelationship here :
    Now you can plot the data on the graph

    Pbix is attached, so you can follow my steps

    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
    2 years ago

    Hi smerugu28 
    Did you see my response?
    I gave a detailed solution step by step with screenshots, links to tutorials, and PBIX...