Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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?
Solved! Go to Solution.
You could try
Num diff > 0 = COUNTROWS( FILTER( 'Table', [Price difference] > 0 ) )
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%"
)
You could try
Num diff > 0 = COUNTROWS( FILTER( 'Table', [Price difference] > 0 ) )
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!