Forum Discussion
Blank Values on KPI Card
Good morning,
I'm have an issue with DAX in two measures I'm attempting to show on Card w/States. Basically I'm trying to show the number of instagram fans in the current month and prior month. Below are my DAX measures. To me, when values are displayed as BLANK it looks sloppy. So I tried an IF statement and I'm getting either NaN or Inifity value. Any of you DAX Masters have any suggestions on how to solve this issue?
Thanks
CurrentPageFans =
CALCULATE (
SUM ( 'FBInsightsData'[page_fans] ),
FILTER (
'FBInsightsData',
'FBInsightsData'[MetricDate] = MAX ( 'DateSeries'[menddate] )
)
)PriorPageFans =
CALCULATE (
SUM ( 'FBInsightsData'[page_fans] ),
FILTER (
'FBInsightsData',
'FBInsightsData'[MetricDate] = MIN ( 'DateSeries'[sdate] )
)
)5 Replies
- MFelixSuper User
Hi Anonymous
Just add a + 0 to your measures, should return 0 when value is blank so your formulas will look:
CurrentPageFans = CALCULATE ( SUM ( 'FBInsightsData'[page_fans] ), FILTER ( 'FBInsightsData', 'FBInsightsData'[MetricDate] = MAX ( 'DateSeries'[menddate] ) ) ) + 0 PriorPageFans = CALCULATE ( SUM ( 'FBInsightsData'[page_fans] ), FILTER ( 'FBInsightsData', 'FBInsightsData'[MetricDate] = MIN ( 'DateSeries'[sdate] ) ) ) + 0Regards,
MFelix
- AnonymousNot applicable
Hi MFelix
That worked for the CurrentPageFans measure perfectly. Thank you for that!
However where I'm calculating the prior period it's showing the following. Any thoughts?
- MFelixSuper User
Hi Anonymous,
The NaN% from where? How are you setting up your information what is the visual you are using.
Regards,
MFelix