Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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.
J
Solved! Go to Solution.
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:
Your output will look like this:
In this case is just showing one month because i used data provided by you in the comments sections.
Thank you
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:
Your output will look like this:
In this case is just showing one month because i used data provided by you in the comments sections.
Thank you
@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.
@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.
@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 ,
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?
Hi @jbrines, please use groups
Right-click on your column 'Company', group it, use the group in the chart
Did I answer your question? Mark my post as a solution!
Hi @MattiaFratello ,
We have Companies being added all the time, would they be automatically added or would we have to do it manually?
J
Then why not to create a new column in the Power Query Editor, if the semantic model is not too big...
Did I answer your question? Mark my post as a solution!
@jbrines how you determine which is "my company"? Can you share sample data with the expected output?
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
65 | |
51 | |
45 |
User | Count |
---|---|
217 | |
88 | |
81 | |
65 | |
56 |