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
okikuswanda
Frequent Visitor

Calculate Remove Date Blank Value

Hi, i have dax measure for calculated column like this 

RealisasiEkvUSDCumTest:=
VAR MaxDate = CALCULATE(MAX(DimDate[Date]) , RELATEDTABLE(FactInvestment))
RETURN
CALCULATE (
SUM ( FactInvestment[RealisasiEkvUSD]),
FILTER (
ALLSELECTED(DimDate),
DimDate[Date] <= MaxDate)
)

but, i want remove that month have no value like image below (blank value is Oct-Dec), Thanks ... 
Screenshot_3.jpg

2 ACCEPTED SOLUTIONS
stevedep
Memorable Member
Memorable Member

Hi,

See below;

RealisasiEkvUSDCumTest:=
VAR MaxDate = CALCULATE(MAX(DimDate[Date]) , RELATEDTABLE(FactInvestment))
RETURN

If (is blank(sum(FactInvestment[RealisasiEkvUSD]) ) = true(), blank(),
CALCULATE (
SUM ( FactInvestment[RealisasiEkvUSD]),
FILTER (
ALLSELECTED(DimDate),
DimDate[Date] <= MaxDate)
))

View solution in original post

themistoklis
Community Champion
Community Champion

@okikuswanda 

 

You can try the following formula

 

 

 

RealisasiEkvUSDCumTest:=
VAR _MaxDate = CALCULATE(MAX(DimDate[Date]) , RELATEDTABLE(FactInvestment))
RETURN

IF( SELECTEDVALUE(DimDate[Date])<=_MaxDate ,
CALCULATE (
SUM ( FactInvestment[RealisasiEkvUSD]),
DATESYTD(DimDate[Date]))
)

 

 

View solution in original post

2 REPLIES 2
themistoklis
Community Champion
Community Champion

@okikuswanda 

 

You can try the following formula

 

 

 

RealisasiEkvUSDCumTest:=
VAR _MaxDate = CALCULATE(MAX(DimDate[Date]) , RELATEDTABLE(FactInvestment))
RETURN

IF( SELECTEDVALUE(DimDate[Date])<=_MaxDate ,
CALCULATE (
SUM ( FactInvestment[RealisasiEkvUSD]),
DATESYTD(DimDate[Date]))
)

 

 

stevedep
Memorable Member
Memorable Member

Hi,

See below;

RealisasiEkvUSDCumTest:=
VAR MaxDate = CALCULATE(MAX(DimDate[Date]) , RELATEDTABLE(FactInvestment))
RETURN

If (is blank(sum(FactInvestment[RealisasiEkvUSD]) ) = true(), blank(),
CALCULATE (
SUM ( FactInvestment[RealisasiEkvUSD]),
FILTER (
ALLSELECTED(DimDate),
DimDate[Date] <= MaxDate)
))

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.

Top Solution Authors