Forum Discussion
Anonymous
5 years agoNot applicable
Calculating a measure based on conditional result from another measure
Hello, I'm currently trying to set up a measure which works as follows. There is a measure which calculates the absolute change in the share within a market. So let's say you have country UK,...
goncalogeraldes
Super User
5 years agoYou can either incorporate everything in one single measure or reference your past measures: Whichever works better for your dataset:
Positive Absolute Share Growth =
var ly_sales = Calculate(SUM(Facts[Sales EURO]), Calendar[Year] = "LY")
var ty_sales = Calculate(SUM(Facts[Sales EURO]), Calendar[Year] = "TY")
var ly_mark_share = DIVIDE(ly_sales, CALCULATE(ly_sales, ALL(Products[Company])))
var ty_mark_share = DIVIDE(ty_sales, CALCULATE(ty_sales, ALL(Products[Company])))
var share__growth = ty_mark_share - ly_mark_share
var total_sales = SUM(Facts[Sales EURO])
return
IF( share_growth > 0, total_sales, 0)Or:
Positive Absolute Share Growth =
var share__growth = [Market Share Growth]
var total_sales = SUM(Facts[Sales EURO])
return
IF( share_growth > 0, total_sales, 0)
Hope this answer solves your problem! If you need any additional help please tag me in your reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
Thanks!
Best regards,
Gonçalo Geraldes
Anonymous
5 years agoNot applicable
Hi, unfortunately, this is not giving me the right answer, the measure when added to a card returns zero.