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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Ubedulla1988
Regular Visitor

Need assistance with SWITCH function with positive and negative percentages.

Hi Team,
I have a requirement to show "increased", "decreased" and "remained flat at".
I have a measure which returns percentage, If the percentage is between -0.05 and 0.05 then "remained flat at".
If percentage is > 0.05 then "increased"
If percentage is > -0.05 then "increased". I am getting incorrect results even after applaing correct logic using SWITCH.
Please check the measure defination and suggest me.
My percenage measure values is 0.4 which is greate then 0.05, it should show "has increased by", but it is returing "has decreased by". Please check and suggest.
Swich issue.pngSwitch issue.pngSwitch issue.png1.png

1 ACCEPTED SOLUTION

Ubedulla1988,

 

Read the edit in the message you responded to and see if that's what you're looking for.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

 

P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

7 REPLIES 7
HotChilli
Super User
Super User

Remove all the FORMAT stuff, it will convert to string and you don't want that.

It's easier to start with a simple IF to test these things so that you can get something simple to work before writing the whole thing.

Please refer the below screenshot. Percentage is 1.1%, Still I could see "has remained flat at",  it supposed to be "has increased by".
720.png

Thank you..

Hi Ubedulla1988,

 

Again, as @gmsamborn mentioned, you are incorrectly comparing a percentage with a decimal. 1.1% is not greater than 0.05 (aka 5%). 1.1% is greater than -0.05 (aka -5%) and is less than 0.05 (aka 5%) and therefore meets your second criteria. Therefore, it is correctly returning "has remained flat at" per your expected logic.

 

EDIT: It sounds like you might actually be wanting 0.05% and -0.05%, which are 0.0005 and -0.0005 respectively.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

 

P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Would you please suggest me, who would i achive this, The requirement 
I have a requirement to show "increased", "decreased" and "remained flat at".
I have a measure which returns percentage, If the percentage is between -0.05 and 0.05 then "remained flat at".
If percentage is > 0.05 then "increased"
If percentage is > -0.05 then "increased".

Ubedulla1988,

 

Read the edit in the message you responded to and see if that's what you're looking for.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

 

P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thanks for responding on issue.
Even after removing Formate, still see incorrect results. If you look at the percentage, it is 0.4 which is bigger than 0.05 and It should return "has increased by". But it is returning "has remained flat at".

Switch issue.png0720.png

Hi @Ubedulla1988 

 

It looks like you are comparing a percentage with a basic number.

 

.4% is actually equal to .004 which you are comparing to .05 (5%)

 

Also, the line comparing _Check with "--" won't do anything since _Check is a number, not a string.



Proud to be a Super User!

daxformatter.com makes life EASIER!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors