Forum Discussion
Show Text for no data - Dax
I need a dax that will retun text "RDO" for the date that work is showing blank in the below snip. To show the blank i used show data with no values on the date.
Work measure below "
Many thanks for the help.
Anonymous Not sure if it will help but here:
Any chance you can share sample data as text so that I can mock this up?
Hi Anonymous
When a measure is forced to display something other than its actual value when blank, the formula engine performs a full cross-join of the dimension tables in the visual, evaluating each row explicitly. This can result in unexpected data points appearing. For example, a previously removed ID (e.g., one terminated in 2013) may still appear for a selected period, such as late February, but with custom values. That's why you're seeing RDO for those that are not within the slicer selection. You can add a condition to your measure to show only when a date is within the selected range.
VAR MinDate = CALCULATE ( MIN ( 'calendar'[date] ), ALLSELECTED ( 'calendar' ) ) VAR MaxDate = CALCULATE ( MAX ( 'calendar'[date] ), ALLSELECTED ( 'calendar' ) ) RETURN IF ( SELECTEDVALUE ( 'calendar'[date] ) >= MinDate && SELECTEDVALUE ( 'calendar'[date] ) <= MinDate, [rdo measure] )
6 Replies
- Greg_DecklerCommunity Champion
Anonymous Well, you could create a measure like the following perhaps:
Measure = VAR __Work = SUM( 'Table'[Work] ) VAR __Result = IF( ISBLANK( __Work ), "RDO", __Work & "" ) RETURN __ResultYou may also need to change the Value filter behavior (auto-exist) for your Semantic model on the Model view.
- AnonymousNot applicable
how do i change the value filter behaiour? i tried the dax but is showing RDO multiple time other than for just the selected date with blank.
- Greg_DecklerCommunity Champion
Anonymous Not sure if it will help but here:
Any chance you can share sample data as text so that I can mock this up?
- Ashish_MathurSuper User
Hi,
It is not a good practise to have formulas return mixed data types.