Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi All,
I know, this is something relatively easy, but i cannot figure out my issues with this DAX . Below is my scenario..
I have Sales measure which gives me total sales of selected year in Slicer.
I also have Previous year sales measure which gives me Last year sales.
Based on that, I am calcuating growth rate, which is also in another measure.
My growth rate formula look like,
DIVIDE('Measure Dimension for Product'[Measure Selection for Product]-[Last Year],[Last Year])
format is Percentage..
Now, i am segemnting this growth rate by different category like 1,2,3
for example,
if the growth rate is 0 to 25 , then 1
if the growth rate is 26 to 50 , then 2
if the growth rate is greater than 100,3
else,0
for that, logic i have written below formula,
Does not work.. It gives me only 1 or 0.. when growth rate is also 26
to 50.. It shows also 1.
I have tried with Switch statement also,
Solved! Go to Solution.
Hi @snandy2011
It could be that your measure is yielding results different from what you expect.
In any case, try using 0,25 instead of 25, 0,50 instead of 50, etc. Those are the real values of your division even though you are formatting them as percentage.
I apologize to everybody for asking this stupid question. I should have sticked with that issues and sloved by myself.Actually, I lost patience.. After some hours, i found out the actual reason when i did it on Excel. The issues was that, i changed the format of that measures. and within if function i was using only integer number, i should have used decimal number.when i did it on excel it came into my mind..
Thanks to everyone, for your reply and your valueable time..and sorry once again for asking this stupid type question.
Thanks,
snandy
I am afraid the growth rate is between 25 and 26. Depends on your coding logic, it will also show as 0 when your value is between 25 and 26. Please show the value with one decimal number and double check.
You can try modify the coding like below.
Proud to be a Super User!
Seems you meant to categorize a percentage, .e.g. 0-25% , 25%-50%.
Your formula checks integer values, not percentages.
On the other hand, your formula does not include values above 50 which may be the case that actual values are above 50 (or 50%) and is not recognized, so the formula returns 0
Can you provide a sample data to check it please
Hi @snandy2011
It could be that your measure is yielding results different from what you expect.
In any case, try using 0,25 instead of 25, 0,50 instead of 50, etc. Those are the real values of your division even though you are formatting them as percentage.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
99 | |
68 | |
44 | |
37 | |
29 |
User | Count |
---|---|
156 | |
92 | |
62 | |
44 | |
41 |