Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
jbrines
Advocate III
Advocate III

Create a chart that shows one Company against the rest

Hi Guys,

 

I have two columns Company and Created.

 

The Company one has multiple Comapny Names but also My company name.

 

I want to be able to show a chart with a count of My Comapny Name and count of the rest.

 

Would also like to base these number over Monthly counts.

 

Many thanks.

 

1 ACCEPTED SOLUTION
Bibiano_Geraldo
Super User
Super User

HI @jbrines ,
To achieve your goal of creating a chart that counts Clark Contracts as one bar and all other companies as another bar, and also bases these counts on a monthly basis, you can use the bellow DAX measures:

1- Create a Measure for "Clark Contracts" Count:

ClarkContractsCount = 
CALCULATE(
    COUNTROWS('Table'), 
    'Table'[Company] = "Clark Contracts"
)

 

2- Create a Measure for "Rest" Count:

RestCount = 
CALCULATE(
    COUNTROWS('Table'), 
    'Table'[Company] <> "Clark Contracts"
)

 

Once these measures are created, you can use them in a Clustered Bar Chart:

  • Drag the Month (or just use Year-Month if needed) to the Axis of the chart.
    Add the ClarkContractsCount and RestCount measures to the Values section.

Your output will look like this:

Bibiano_Geraldo_0-1738674039899.png

In this case is just showing one month because i used data provided by you in the comments sections.

 

Thank you

View solution in original post

23 REPLIES 23
Bibiano_Geraldo
Super User
Super User

HI @jbrines ,
To achieve your goal of creating a chart that counts Clark Contracts as one bar and all other companies as another bar, and also bases these counts on a monthly basis, you can use the bellow DAX measures:

1- Create a Measure for "Clark Contracts" Count:

ClarkContractsCount = 
CALCULATE(
    COUNTROWS('Table'), 
    'Table'[Company] = "Clark Contracts"
)

 

2- Create a Measure for "Rest" Count:

RestCount = 
CALCULATE(
    COUNTROWS('Table'), 
    'Table'[Company] <> "Clark Contracts"
)

 

Once these measures are created, you can use them in a Clustered Bar Chart:

  • Drag the Month (or just use Year-Month if needed) to the Axis of the chart.
    Add the ClarkContractsCount and RestCount measures to the Values section.

Your output will look like this:

Bibiano_Geraldo_0-1738674039899.png

In this case is just showing one month because i used data provided by you in the comments sections.

 

Thank you

Hi @Bibiano_Geraldo ,

 

How do I sort it do it is sorted by month newest to oldest?

 

Screenshot 2025-02-04 152347.jpg

hi @jbrines ,

To sort, select your chart, click on 3 dots, and go to sort axis and choose to sort descending, and make sure that is sorted by month also:

Bibiano_Geraldo_0-1738740734721.png

 

That doesn't seem to sort it in months it sorts it in alphabethical order.

 

Screenshot 2025-02-05 140139.jpg

Hi @Bibiano_Geraldo any ideas on how to resolve?

 

Thanks

 

J

Hi @jbrines ,

Sorry to be late, i lost your previous reply, please @me to not lose any reply.

 

Lets dive right in.

To achieve your goal, you need to create a calculate column for month names and other calculated column to sort this months, just follow this steps:

 

1- Make sure that you have a calendar table, if not, just create with this DAX:

Calendar = 
CALENDAR(
    MIN(financials[Date]), //please refer your Created Date column here
    MAX(financials[Date]) //please refer your Created Date column here
)


This should in a table like this:

Bibiano_Geraldo_0-1739375955956.png


2- Now, In your calendar table create a column for Month Name by this DAX:

Month = FORMAT('Calendar'[Date],"Mmmm")

 

3- And another calculated column for Month No:

Month No = VALUE(FORMAT('Calendar'[Date],"m"))

At this point, you table should look like this:

Bibiano_Geraldo_1-1739376145461.png

 

4- Select your Month Name column and sort by Month No as shown bellow:

Bibiano_Geraldo_2-1739376253525.png

 

5- Mark the table as calendar table by right click on top of calendar table:

Bibiano_Geraldo_3-1739376363030.png


now enable mark as  date table and from dropdown choose date column and click in Save:

Bibiano_Geraldo_4-1739376469079.png

 

6- Create a relationship between your table and calendar table using date column:

Bibiano_Geraldo_5-1739376581824.png

 

Now in your visual, use the Month Name in X-Axis.

 

Hi @Bibiano_Geraldo 

 

When you say "Now in your visual, use the Month Name in X-Axis" do you man the month name from the Calander Table as I can't get it working from either.

 

John

Yes, the Month from calendar table

Hi @Bibiano_Geraldo that doesn't work see below.

 

Screenshot 2025-02-13 155019.jpg

can you share the picture of your calendar table?
Are these tables related?

its possible to share no sensitive file to check closer?

@Bibiano_Geraldo  see below.

 

Screenshot 2025-02-13 155841.jpgScreenshot 2025-02-13 155816.jpg

At this point look great, si possible to upload a no sensitive file to check what is causing this on your repor?

@Bibiano_Geraldo can I send it via email? If you PM me an email address?

Hi @Bibiano_Geraldo ,

 

Worked a treat many thanks.

 

J

parry2k
Super User
Super User

@jbrines I just stored my company in a measure to make the solution scalable, in case  my company name  changes. In this case, you just need to replace "Clark Contacts" with the new value.

 

To keep it simple, you can always replace the "my company" measure with the fixed value "Clark Contacts" or use the new measures that I provided. I always look for the solution which is easy to manage and scalable. Cheers!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@jbrines change it to this:

 

Measure My Company = 
VAR __MyCompany = [Measure My Company]
RETURN
CALCULATE ( 
    [Measure Count],
    KEEPFILTERS ( Table[Company] = __MyCompany  )
)

Measure Rest = 
VAR __MyCompany = [Measure My Company]
RETURN
CALCULATE ( 
    [Measure Count],
    KEEPFILTERS ( Table[Company] <> __MyCompany )
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@jbrines create the following 4 measures to achieve the result, use "Measure My Company" and "My Rest" in the visual. You can always name the measures whatever you want.

 

Measure My Company = "Clark Contacts"

Measure Count = COUNTROWS ( Table )

Measure My Company = 
CALCULATE ( 
    [Measure Count],
    KEEPFILTERS ( Table[Company] = [Measure My Company] )
)

Measure Rest = 
CALCULATE ( 
    [Measure Count],
    KEEPFILTERS ( Table[Company] <> [Measure My Company] )
)

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k ,

 

Getting the following on messre 3 and 4.

 

Screenshot 2025-02-04 122025.jpg

jbrines
Advocate III
Advocate III

Hi @parry2k ,

 

See sample below.

 

I am looking to show a chart that two bars (Clark Contracts and the Rest).

 

From the sample Clark Contacts will have a count of all Clark Contracts and the rest will have a count of everything except Clark Contracts.

 

I hope that makes sense?

 

Screenshot 2025-02-04 120145.jpg

 

Hi @jbrines, please use groups

Right-click on your column 'Company', group it, use the group in the chart

MattiaFratello_0-1738671128791.png

 

MattiaFratello_1-1738671139759.png

 

 

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.