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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
LABrowne
Helper II
Helper II

DAX: How to register blank values as zero

Hi there,

 

I am currently working on a different formulas within my table on Power BI.

 

CALCULATE(SUM(OrderTable[Amount]),OrderTable[OrderTypeId] = 22 || OrderTable[OrderTypeId] = 24, OrderTable, OrderTable[IsDeleted] = False, OrderStatus[OrderStatusId] <> 7)
 
This works in adding up certain types of orders, doesn't sum deleted orders and removes orders that were cancelled.
 
The problem is sometimes it is returning blank values which is correct but how can I say if there values/sum ISBLANK = $0.00?
 
Any advice would be great!
 
Kind regards,
Luke
1 ACCEPTED SOLUTION
Arpitb12
Helper I
Helper I

You can use the IF and ISBLANK functions in Power BI to conditionally display "$0.00" when the result is blank. 
Result = VAR TotalAmount = CALCULATE( SUM(OrderTable[Amount]), OrderTable[OrderTypeId] = 22 || OrderTable[OrderTypeId] = 24, OrderTable[IsDeleted] = False, OrderStatus[OrderStatusId] <> 7 ) RETURN IF( ISBLANK(TotalAmount), "$0.00", TotalAmount )

View solution in original post

3 REPLIES 3
Arpitb12
Helper I
Helper I

You can use the IF and ISBLANK functions in Power BI to conditionally display "$0.00" when the result is blank. 
Result = VAR TotalAmount = CALCULATE( SUM(OrderTable[Amount]), OrderTable[OrderTypeId] = 22 || OrderTable[OrderTypeId] = 24, OrderTable[IsDeleted] = False, OrderStatus[OrderStatusId] <> 7 ) RETURN IF( ISBLANK(TotalAmount), "$0.00", TotalAmount )

Thank you a lot!

Jihwan_Kim
Super User
Super User

Hi,

Please check the link down below, and try to use it with your formula.

I hope this helps.


COALESCE function (DAX) - DAX | Microsoft Learn

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.