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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors