Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Create column chart from SharePoint Online list

Hi,

I am new to Power BI. I am fetching data from SharePoint Online.

The table looks like:

I want to make a bar chart with the count of each Theraputic Area (Fertility, Oncology, etc).

To count the occurances I am using a measure:

TA1 = CALCULATE(COUNTROWS('SWDHomeList'),'SWDHomeList'[TherapeuticArea]<>"Neurodegenerative Diseases")
I have created a measure for each Theraputic area.
But the end result is not coming as expected.

As you can see here all x-axis shows proper values, but the columns are all clustered together, I want one column for each Theraputic Area, something like this:

I'd appriciate your help, thanks in advance. 

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    I am confused about your measure. 

    From your statement, you created multiple measures to get the count of each Theraputic Area (TA).

    Ex: TA1= Neurodegenerative Diseases

    So your measure should use "=" instead of"<>" in filter.

    TA1 = CALCULATE(COUNTROWS('SWDHomeList'),'SWDHomeList'[TherapeuticArea] = "Neurodegenerative Diseases")

    If you want to count each Therapytic Area in X axis, you can add this column directly in visual and power bi has count function in visual. You don't need to build multiple measures to count.

     

    Best Regards,

    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

  • Anonymous , You have taken more than one measure, that is why is showing all those. Do you want to have a switch to all those measures?

     

    The information you have provided is not making the problem clear to me. Can you please explain with an example.

    Appreciate your Kudos.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi amitchandak ,

      I created multiple measures to get the count of each Theraputic Area (TA).

      For example TA1= Neurodegenerative Diseases

      I am open to a different approach alltogether.

      I just want all the diferent TAs on the x-axis and each column sould represent the count of each TA.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

     

    Best Regards,

    Rico Zhou