Forum Discussion

paopau86's avatar
paopau86
New Member
7 years ago
Solved

Issues with bar & line chart

Hi - I created a stacked bar/line chart to show two sets of data, the first column (bars) show dates when someone contacted me, and the second column (line) shows when an actual meeting was scheduled. The chart seems to be having problems when the contact and meeting happened in different months, e.g. if someone contacted me on 11/15/2018 and the meeting was scheduled on 12/5/2018, the chart is showing the contact in November, which is accurate, but it is showing that the meeting also happened in November, which is inaccurate. Any thoughts on how to solve this?

 

Thanks,

Paola

  • Hi paopau86

    1. Open Edit queries

    click on columns "contact" and "meeting", select "transform"->unpivot columns

    then i get the following table

    close &apply

    2.

    create a new table, enter the formula in the formula bar in"Home"->"new table"

    date = CALENDARAUTO()

    create a relationsip between this date table and my data table

    3. create two measures

    contacts = CALCULATE(DISTINCTCOUNT(Sheet5[company]),FILTER(Sheet5,Sheet5[Attribute]="contact"))
    
    meeting = CALCULATE(DISTINCTCOUNT(Sheet5[company]),FILTER(Sheet5,Sheet5[Attribute]="meeting"))

     

    Best Regards

    Maggie

     

    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Very tough without example data and expected output. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

     

    That being said, see if these quick measures help:

    https://community.powerbi.com/t5/Quick-Measures-Gallery/Periodic-Billing/m-p/409365

    https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364

     

     

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi paopau86

    Based on my experience, it seems you didn't use the chart correctly.

    please share a simple dataset as an example and tell me what you need to see from the visual, so that i can reproduce your scenario and help you create the correct visual.

     

    Best Regards

    Maggie

    • paopau86's avatar
      paopau86
      New Member

      Thank you so much for the responses - I am new user of Power BI and I am trying to learn as I go (planning on taking a course soon), I appreciate your assistance. 

      Below is a sample of the information I want to show in a chart. Basically, I would like to show in a bar how many people I contacted every month (e.g. August would have two contacts and in september 1) and then in a line show how many meetings occurred on the given month (one meeting in August, and two in september).

       

      Thanks again!

      Paola

       

       

       

      • v-juanli-msft's avatar
        v-juanli-msft
        Community Support

        Hi paopau86

        1. Open Edit queries

        click on columns "contact" and "meeting", select "transform"->unpivot columns

        then i get the following table

        close &apply

        2.

        create a new table, enter the formula in the formula bar in"Home"->"new table"

        date = CALENDARAUTO()

        create a relationsip between this date table and my data table

        3. create two measures

        contacts = CALCULATE(DISTINCTCOUNT(Sheet5[company]),FILTER(Sheet5,Sheet5[Attribute]="contact"))
        
        meeting = CALCULATE(DISTINCTCOUNT(Sheet5[company]),FILTER(Sheet5,Sheet5[Attribute]="meeting"))

         

        Best Regards

        Maggie

         

        Community Support Team _ Maggie Li
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.