Forum Discussion
TeisL
4 years agoFrequent Visitor
Only show rows when value is changed (based on date)
Hi all, I'm fairly new in the community and I'm struggling with this issue for over weeks now. I hope somebody can help me out: I have a table with 4 columns: * WKN = my ID * AARDCONT = th...
- 4 years ago
Needs REMOVEFILTERS
Row Is Visible = var bdValues = CALCULATETABLE( VALUES( 'data'[WKN]), REMOVEFILTERS(data), 'data'[AARDCONT] = "BD", USERELATIONSHIP('Calendar'[Date], 'data'[Till]) ) var odValues = CALCULATETABLE( VALUES('data'[WKN]), REMOVEFILTERS(data), 'data'[AARDCONT] = "OD") return IF( SELECTEDVALUE( 'data'[WKN] ) IN INTERSECT( bdValues, odValues), 1, 0)
johnt75
4 years agoSuper User
Firstly you'll need a Date table which is not connected to your fact table, for use in the slicer. If your main Date table is not connected then you can use that, otherwise you will need to create a new table just for use in the slicer.
When you have added the disconnected date table to a slicer on the page, you can create a measure like
Row Is Visible =
VAR minDate =
MIN ( 'Date Slicer'[Date] )
VAR maxDate =
MAX ( 'Date Slicer'[Date] )
VAR result =
IF (
(
SELECTEDVALUE ( 'Table'[AARDCONT] ) = "BD"
&& SELECTEDVALUE ( 'Table'[Till] ) >= minDate
&& SELECTEDVALUE ( 'Table'[Till] ) <= maxDate
)
|| (
SELECTEDVALUE ( 'Table'[AARDCONT] ) = "OD"
&& SELECTEDVALUE ( 'Table'[From] ) >= minDate
&& SELECTEDVALUE ( 'Table'[From] ) <= maxDate
),
1,
0
)
RETURN
resultand add this measure as a visual filter to your table, to only show when the value is 1