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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jeyjey344
Helper I
Helper I

Measure applies to blank, empty rows

Hi,

 

I created a measure that compares year to year sale.  Right now, there are only 2 main accounts in use (from 100 avaliable in table). When I add my measure to matrix table, all of them appears, even if there are no values (exept from measure that is -100% in that case). Please see screens below, to help you understand my problem. On the 2nd screen i would like to see only accounts with values.

 

I think, that I need to modyfy my measure, to not apply to empty rows, but I don't have good idea for that.

 

Measure: Zmiana % = IFERROR(([Kwota za 2021]/[Kwota za 2020] -1), "")

 

1.jpg2.JPG
2 ACCEPTED SOLUTIONS
AllisonKennedy
Super User
Super User

What are you trying to calculate exactly?

You could try IF(ISBLANK([Kuota za 2021]),

But also, use the DIVIDE function.

Measure: Zmiana % = DIVIDE( [Kwota za 2021] , [Kwota za 2020] -1) )

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

Hi @AllisonKennedy , thank you for your reply. I wanted to apply measure only if one of [Kwota za 2021] or [Kwota za 2020] is not empty. But I realized that it will be fine to just check if one of them is empty.

 

I ended up with measure

Zmiana % = IF(ISBLANK([Kwota za 2020]) = TRUE(), Blank(), DIVIDE( [Kwota za 2021] , [Kwota za 2020] ) -1 )
 
I was not able to do it before since I was using ISEMPTY instead of ISBLANK.
Final resoult looks like this, and it is correct now (If more accounts comes, it will look more natural 🙂 )
 
3.JPG

View solution in original post

3 REPLIES 3
AllisonKennedy
Super User
Super User

What are you trying to calculate exactly?

You could try IF(ISBLANK([Kuota za 2021]),

But also, use the DIVIDE function.

Measure: Zmiana % = DIVIDE( [Kwota za 2021] , [Kwota za 2020] -1) )

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hi @AllisonKennedy , thank you for your reply. I wanted to apply measure only if one of [Kwota za 2021] or [Kwota za 2020] is not empty. But I realized that it will be fine to just check if one of them is empty.

 

I ended up with measure

Zmiana % = IF(ISBLANK([Kwota za 2020]) = TRUE(), Blank(), DIVIDE( [Kwota za 2021] , [Kwota za 2020] ) -1 )
 
I was not able to do it before since I was using ISEMPTY instead of ISBLANK.
Final resoult looks like this, and it is correct now (If more accounts comes, it will look more natural 🙂 )
 
3.JPG

Ah, yes, ISEMPTY works on tables, not on columns/single values.

You don't need the =TRUE() in your formula since the IF statement already accounts for TRUE() values and ISBLANK() will return TRUE() or FALSE, but it's working so that's great!

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.