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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
hansei
Helper V
Helper V

Calculate the count of column equaling measure

I have a table with a calculated column

Allowed = [Billed] - [Adjusted]
ID  Code  Billed  Adjusted  Allowed
1   A     100     50        50      
2   A     200     150       50      
3   A     100     25        75      
4   A     200     150       50      
5   A     100     25        75      
6   B     100     20        80       
7   B     125     45        80       
8   B     200     120       80
9   B     100     25        75      
10  B     145     70        75

I also have a measure for the arithmetic mode of [Allowed]

Allowed Mode := MINX(
	TOPN(
		1, 
		ADDCOLUMNS(
			VALUES('Charge Fact'[Allowed]), 
			"Frequency", CALCULATE(COUNT('Charge Fact'[Allowed]))
		), 
		[Frequency], 
		0
	), 
	'Charge Fact'[Allowed]
)

So, with the example data a matrix might appear like

Code   Count   Avg   Mode   Freq
A 5 60 50 3
B 5 78 80 3
Total 10 69 75 4

What I would like to do is get the measure for how many rows are equal to the mode. [Freq] in the above matrix, but haven't been able to

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@hansei not fully sure if this is what you are looking for, here is the measaure to calculate frequency

 

Allowed Mode Count = 
VAR __mode = [Allowed Mode]
RETURN
 CALCULATE( COUNT( Table2[ID] ),
   
    Table2[Allowed] =__mode
)


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.

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

@hansei not fully sure if this is what you are looking for, here is the measaure to calculate frequency

 

Allowed Mode Count = 
VAR __mode = [Allowed Mode]
RETURN
 CALCULATE( COUNT( Table2[ID] ),
   
    Table2[Allowed] =__mode
)


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.

Exactly what I was looking for. Thanks @parry2k 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.