cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Post Prodigy

## If the cell is empty then insert "-"

Hey All!

I try to include in my Measure the condition that if the cell is empty
Then replace with "-"
Can help?

Net USD AVG =

VAR NumDays=
CALCULATE (
DISTINCTCOUNT ('DB 2022'[Date] ),
KEEPFILTERS( 'Date'[Date] < TODAY() ),
NOT ISBLANK ( 'DB 2022'[Net USD]),
REMOVEFILTERS ( 'SORT GL' )
)

VAR SumNet =
CALCULATE (
SUM ( 'DB 2022'[Net USD]),
KEEPFILTERS( 'Date'[Date] < TODAY() )
)

RETURN DIVIDE (SumNet, NumDays)

Mark my post as a solution!

1 ACCEPTED SOLUTION
Community Champion

Go on with VAR,

``````...
VAR RES = DIVIDE (SumNet, NumDays)
RETURN IF( ISBLANK(RES), "-", RES )
``````

 Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! DAX is simple, but NOT EASY!
4 REPLIES 4
Community Champion

Go on with VAR,

``````...
VAR RES = DIVIDE (SumNet, NumDays)
RETURN IF( ISBLANK(RES), "-", RES )
``````

 Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! DAX is simple, but NOT EASY!
Community Champion

@netanel  try this

VAR NumDays=
IF(ISBLANK(DISTINCTCOUNT ('DB 2022'[Date] ),"-",
CALCULATE
(
DISTINCTCOUNT ('DB 2022'[Date] ),
KEEPFILTERS'Date'[Date] < TODAY() ),
NOT ISBLANK ( 'DB 2022'[Net USD]),
REMOVEFILTERS ( 'SORT GL' )
)

and also in divide function use this and see whether you are getting final out come
if in the place of denominator if you get "-" , then accordingly rest of the measure will take care

RETURN DIVIDE (SumNetNumDays,"-"

MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!

Community Champion

if(isblank(measure/column),"-",required Dax) hope this helps!

MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!

Post Prodigy

Of course I tried if isblank
But I can not incorporate this correctly in my Measure

Mark my post as a solution!

Announcements

#### Power BI Monthly Update - November 2023

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

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors