Forum Discussion
percentile calculation
I put that comment in for the post only...(but I didn't recall the // syntax for a comment in the code, so thanks!)
The error message reads as below which didn't help me much. I was surprised it said Median is incorrect--so thought that perhaps the UpperMiddle was fine? Anyway, here it is...
The syntax for 'Median' is incorrect. (DAX(
Var UpperMiddle = PERCENTILE.EXC([TotalProfitMargin], 0.75)
VAR Median = PERCENTILE.EXC([TotalProfitMargin], 0.50)
VAR LowerMiddle = PERCENTILE.EXC([TotalProfitMargin], 0.25)
RETURN
SWITCH (
TRUE(),
[TotalProfitMargin] > UpperMiddle, "Q1",
[TotalProfitMargin] > Median, "Q2",
[TotalProfitMargin] > LowerMiddle, "Q3",
"Q4")
)).
DOH!!! Median is an improper variable name as it's a reserved word! Boy, sorry to bother everyone!!!