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! Learn more

Reply
admin11
Memorable Member
Memorable Member

How to remove those row no sales amount using script ?

Hi All

 

My below script is working fine , it allow me to add in new brand :-

 

BRAND_N =
IF ( 'SALES'[BRAND_5] = Blank(),
"No Brand",if(SALES[BRAND_5] in
{"HMS","HAKKO","BECKHOFF","EMERSON","MITSUBISHI","MSA","REDLION","UNIVERSAL","GE","PROJECT","NON ","INTERNAL","MOOG","ABB","PARKER","INTERNAL ","INTERNAL ","INTERNAL ","INTERNAL ","ROBOTIQ"},
'SALES'[BRAND_5], "Other"))
 

admin11_0-1640665757323.png

 

My question is how to modify the above script , so that it will smart enough only display those Brand which have sales value.

 

Paul

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@admin11 not sure why you are using ISBLANK

 

Sales Vari % = 
divide(
[Sales YTD]-[Sales LYTD],
[Sales LYTD]
)

 

Follow us on LinkedIn

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

11 REPLIES 11
parry2k
Super User
Super User

@ALLUREAN doesn't make sense why check for blank() when you are returning blank(), doesn't make sense at all?

 

Just my 2 cents.

 

Follow us on LinkedIn

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@admin11 not sure why you are using ISBLANK

 

Sales Vari % = 
divide(
[Sales YTD]-[Sales LYTD],
[Sales LYTD]
)

 

Follow us on LinkedIn

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

In that case you are right and this will ignore empty values, just tried to understand the % measure logic




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




@parry2k 

Thank you , your script work fine.

@ALLUREAN 

Thank you for your help , after change the sales % vari , it work fine now.

ALLUREAN
Solution Sage
Solution Sage

Hi, @admin11 

 

One way to achieve this is to set IFISBLANK condition in your % measure, so 100% should dissapear from this table




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




@ALLUREAN 

My Table have 3 column , YTD LYTD and Vari % see below image :-

admin11_0-1640667002857.png

 

Can you paste the code for Sales Vari %? And if you remove it from the table, is the empty brands also are not showing?




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




@ALLUREAN 

Yes if i remove the Sales Vari % , the empty row dis-appear.

 

Below is the Sales Vari % expression :-

Sales Vari % = if(isblank( divide(
[Sales YTD]
-
[Sales LYTD]
,
[Sales LYTD]
)),1, divide(
[Sales YTD]
-
[Sales LYTD]
,
[Sales LYTD]
))

try replacing 1 by BLANK()




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




@ALLUREAN 

Thank you for sharing. As my script is a bit complicated , and i am not sure where to insert the condition . Are you able to help me ? Thank you in advance.

What is your Sales Vari % measure?




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.