Forum Discussion
Dax Measure - Ignore Selectedvalue[date], then filter [date2] on selectedvalue[date]
I have a measure similar to the below (context changed)
However it doesn't work, it just returns all rows of the table by the selectedvalue[ReceivedDate] still.
I need it to create a linegraph showing
line A: the total number of 'sausages' received in a period
line B: the total number of 'sausages' 'reallyratherbadlyburnt' in a period
Dead Sausages (Use Received Date as Cooked Date) =
VAR SelectedFromDttm =
SELECTEDVALUE ( 'DD Log'[Received Date] )
RETURN
CALCULATE (
COUNTROWS ( 'DD Log' ),
FILTER ( ALL ( 'DD Log'[ReceivedDate] ), 'DD Log'[CookedDate] = SelectedFromDttm ),
'DD Log'[SausageStatus] = "reallyratherbadlyburnt"
)
Also Tried
Dead Sausages (Use Received Date as Cooked Date) =
VAR SelectedFromDttm =
SELECTEDVALUE ( 'DD Log'[Received Date] )
RETURN
CALCULATE (
COUNTROWS ( 'DD Log' ),
FILTER ( ALL ( 'DD Log'[CookedDate] ), 'DD Log'[CookedDate] = SelectedFromDttm ),
'DD Log'[SausageStatus] = "reallyratherbadlyburnt"
)
and
Dead Sausages (Use Received Date as Cooked Date) =
VAR SelectedFromDttm =
SELECTEDVALUE ( 'DD Log'[Received Date] )
RETURN
CALCULATE (
COUNTROWS ( 'DD Log' ),
FILTER ( ALL ( 'DD Log'), 'DD Log'[CookedDate] = SelectedFromDttm ),
'DD Log'[SausageStatus] = "reallyratherbadlyburnt"
)
Same results.
Please help.
2 Replies
- lbendlin
Super User
Might be easier to help if you could provide sample data and show the expected result.
- Ashish_Mathur
Super User
Hi,
This should work.
- Create a Calendar Table
- Create a relationship (Many to One and SIngle) from The Cooked Date column to the Date column of the Calendar Table
- Create a Date slicer from the Calendar Table and select any date/date range
- Write this measure
Measure = COUNTROWS ( 'DD Log' )
Hope this helps.