Forum Discussion
netanel
Post Prodigy
4 years agoIf 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)
Go on with VAR,
... VAR RES = DIVIDE (SumNet, NumDays) RETURN IF( ISBLANK(RES), "-", RES )
4 Replies
- VijayP
Community Champion
if(isblank(measure/column),"-",required Dax) hope this helps!
- VijayP
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 comeif in the place of denominator if you get "-" , then accordingly rest of the measure will take careRETURN DIVIDE (SumNet, NumDays,"-")
- CNENFRNL
Community Champion
Go on with VAR,
... VAR RES = DIVIDE (SumNet, NumDays) RETURN IF( ISBLANK(RES), "-", RES )