Forum Discussion
Issue with Filtering a Line Chart with Fixed Axis
Hi Guys,
I am showing distinct count of individuals as per time (5min interval) as per zones.
I have three tables:
1) Source: It has data for Individual IDs present in different zones as per 5 min interval across days. There is a column as per shift types here: "Day Shift" (6AM to 6PM current day) and "Night Shift" (6PM current day and 6AM next day)
2) Fixedaxis: This is the calculated table created to fix the x-axis of line chart as per shifts.
3) Shift Type: This is a separate table which only has two rows of "Day Shift" and "Night Shift". This is used in slicer of shift type.
NOTE: I need to use Shift Type Table as a slicer on report, I can't use Shift type from Source table for this due to other modelling constraints.
This is how the data model looks like:
I am creating a line chart with x-axis coming from "Fixed axis" table as I need to fix the start and end time as per shift type like:
Day Shift (DS): 6AM to 5:55PM
Night Shift (NS): 6PM to 5:55AM next day
I created this measure for showing data for Zone: A and D
ADZone =
VAR _DisCount =
CALCULATE (
DISTINCTCOUNT ( 'Source'[IndividualID] ),
FILTER(Source,
'Source'[Zone] IN { "A","D" }
))
RETURN
IF ( ISBLANK ( _DisCount ), 0, _DisCount )Shift Type slicer is from Shift Type table.
This is how the line chart is coming:
This issue is:
- When Day Shift is selected I am getting data for both DS and NS for a single day. Although NS values are "0" when Day Shift is filtered. I want axis to start from 6AM to 6PM only for DS.
- I want filters to work from Shift Type table only. If I use Shift Type filter from Fixedaxis: Chart is getting filtered fine.
Let me know what issue I am facing here might. Seems like some issue with context transition.
I can share the sample report if needed.
Mann.
10 Replies
- AnonymousNot applicable
I would recommend changing your relationship cardinality to single such that the arrow is pointing away from the one and towards the many.
Not sure if that will solve the problem, but that's a good place to start. There's likely ambiguity being introduced into your scenario.- MannResolver IIIHi
I have tried with single filter there but it didnt help. No change.- AnonymousNot applicable
Can you provide the sample file to take a look at?