Forum Discussion
Having problems to add slicer while using date table
- 10 months ago
Hi edgarMunoz ,
Thanks for reaching out to Microsoft Fabric Community and for sharing the file and details.
The reason the entity slicer wasn’t affecting your chart is that the chart is based on a disconnected date table, so slicers from the result table don’t propagate. To achieve the expected behavior, the measures need to explicitly reference both the date and entity filters.
You can create a bridge table
EntityBridge = DISTINCT(result[entityName])with unique entity names and use the entity slicer from this bridge table. This ensures the slicer doesn’t conflict with the date table or other relationships.
Measures like NewAssets and LostAssets can then be defined using SELECTEDVALUE(dateTable[Date]) for the current date in the chart and filtering result by the selected entity from the bridge table.
For example, the NewAssets measure
1NewAssets_SelectedEntity = VAR dateTarget = SELECTEDVALUE(dateTable[Date]) RETURN CALCULATE( COUNTROWS(result), FILTER( result, result[assetsStartDate] = dateTarget && ( ISBLANK(SELECTEDVALUE(EntityBridge[entityName])) || result[entityName] = SELECTEDVALUE(EntityBridge[entityName]) ) ) )counts rows where the asset start date matches the selected date and the entity matches the slicer selection, while the LostAssets measure
1LostAssets_SelectedEntity = VAR dateTarget = SELECTEDVALUE(dateTable[Date]) RETURN - CALCULATE( COUNTROWS(result), FILTER( result, result[assetEndDate] = dateTarget && ( ISBLANK(SELECTEDVALUE(EntityBridge[entityName])) || result[entityName] = SELECTEDVALUE(EntityBridge[entityName]) ) ) )counts rows where the asset end date matches the date.
With this setup, the date slicer from the date table and the entity slicer from the bridge table both work dynamically, and the chart displays the correct per-date bars and line series as expected. You can apply the same pattern for any other calculated measures in the visual.
Please find the .pbix for reference.: Having problems to add slicer while using date table.pbix - Google Drive
Hope this helps. Please reach out for further assistance.
Thank you.
Hi edgarMunoz ,
Thanks for reaching out to Microsoft Fabric Community and for sharing the file and details.
The reason the entity slicer wasn’t affecting your chart is that the chart is based on a disconnected date table, so slicers from the result table don’t propagate. To achieve the expected behavior, the measures need to explicitly reference both the date and entity filters.
You can create a bridge table
EntityBridge = DISTINCT(result[entityName])
with unique entity names and use the entity slicer from this bridge table. This ensures the slicer doesn’t conflict with the date table or other relationships.
Measures like NewAssets and LostAssets can then be defined using SELECTEDVALUE(dateTable[Date]) for the current date in the chart and filtering result by the selected entity from the bridge table.
For example, the NewAssets measure
1NewAssets_SelectedEntity =
VAR dateTarget = SELECTEDVALUE(dateTable[Date])
RETURN
CALCULATE(
COUNTROWS(result),
FILTER(
result,
result[assetsStartDate] = dateTarget &&
(
ISBLANK(SELECTEDVALUE(EntityBridge[entityName])) ||
result[entityName] = SELECTEDVALUE(EntityBridge[entityName])
)
)
)
counts rows where the asset start date matches the selected date and the entity matches the slicer selection, while the LostAssets measure
1LostAssets_SelectedEntity =
VAR dateTarget = SELECTEDVALUE(dateTable[Date])
RETURN
- CALCULATE(
COUNTROWS(result),
FILTER(
result,
result[assetEndDate] = dateTarget &&
(
ISBLANK(SELECTEDVALUE(EntityBridge[entityName])) ||
result[entityName] = SELECTEDVALUE(EntityBridge[entityName])
)
)
)
counts rows where the asset end date matches the date.
With this setup, the date slicer from the date table and the entity slicer from the bridge table both work dynamically, and the chart displays the correct per-date bars and line series as expected. You can apply the same pattern for any other calculated measures in the visual.
Please find the .pbix for reference.: Having problems to add slicer while using date table.pbix - Google Drive
Hope this helps. Please reach out for further assistance.
Thank you.
- edgarMunoz10 months agoFrequent Visitor
Thanks for your help!!!
This is what I needed.