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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Counting measures

Hi,

 

I have a report that compares my company's prices with our competitors. 

 

I have created a list with the following dimensions and measures: Product; Our price; lowest competitor price; Difference between the prices.

That table works just fine.

 

But what I also want to do is to count the number of products where the Difference > 0. In other words I want to count "measures" based on if its positive or negative. 

But when going through all the different "Counts" (Count, Countx,Countax etc) it seems that only column values can be counted. How can I create a measure that count measures?  

 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could try

Num diff > 0 = COUNTROWS( FILTER( 'Table', [Price difference] > 0 ) )

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thanks! But an additonal question: if I want to group these into price diff > 10%, price diff > 5% etc. How do I do that? Can I use the switch-formula for that?

 

 

I would do that as a calculated column, e.g.

Diff grouping =
var pctDiff = DIVIDE( 'Table'[Our price] - 'Table'[Their price], 'Table'[Our price])
return SWITCH( TRUE(),
pctDiff >= 0.5, "> 50%",
pctDiff >= 0.25, "> 25%",
pctDiff >= 0.1, "> 10%",
"< 10%"
)
johnt75
Super User
Super User

You could try

Num diff > 0 = COUNTROWS( FILTER( 'Table', [Price difference] > 0 ) )
mh2587
Super User
Super User

You have to try The Summerization and Countrow Function for that


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.