Forum Discussion
Visualize table with date before a maximum date from a slicer
Hi everyone, I need to create a measure (or other method) to see rows details in my "details page" from my "overview page" not considering start date from slicer date on the "details page".
DATA MODEL
Table Ticket_PBI: ticket_id (type: string), input (integer), output (integer), input_date (date)
Table Calendar_PBI: calendar_date (date)
...are all values from 01/01/2024 to 31/03/2024
Table relationship in the data model: Calendar_PBI (dim table) * -> 1 Ticket_PBI (fact table)
REPORT PAGE 1
I have created a page named 'TICKETS OVERVIEW'.
- I have added the calendar_date (a slicer with a style between) with default values set from start date 01/02/2024 to end date 10/02/2024.
- I have also added a card that shows the sum of inputs without considering the start date of the slicer from point 1. The card contains a DAX measure "stock current" defined as follows: CALCULATE(SUM(Ticket_PBI[input]), FILTER(Ticket_PBI, Ticket_PBI[input_date] <= MAX(Calendar_PBI[calendar_date])), FILTER(Ticket_PBI, ISBLANK(Ticket_PBI[output])))
So, the result of my card will be = 3, as there are only 3 input_dates that are <= the MAX(Calendar_PBI[calendar_date]), which is 10/02/2024.
REPORT PAGE 2
I also created a page named 'TICKETS DETAILS'.
- I have added the calendar_date (a slicer in style between) with default values set from start date 01/02/2024 to end date 10/02/2024. This slicer is synchronized with the slicer from point 1 of the 'TICKETS OVERVIEW' page.
My goal is to display all the ticket_id that meet the "stock current" measure created in point 2. That is, all those ticket_id where their input_date is <= the MAX(Calendar_PBI[calendar_date]) of the slicer.
an example of DESIRED OUTPUT, a table visual with these columns and rows:
- Anonymous2 years ago
Hi simon_pbi_data ,
The Table data is shown below:
Please follow these steps:
1. Use the following DAX expression to create a tableTable = SELECTCOLUMNS('Ticket_PBI',"ticiket_id",'Ticket_PBI'[ticket_id],"input_date",'Ticket_PBI'[input_date])2.Use the following DAX expression to create a measure
_input_date = CALCULATE(SELECTEDVALUE('Table'[input_date]) ,'Table'[input_date] <= MAX('Calendar_PBI'[Date]))3.Final output
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- AnonymousNot applicable
Hi simon_pbi_data ,
The Table data is shown below:
Please follow these steps:
1. Use the following DAX expression to create a tableTable = SELECTCOLUMNS('Ticket_PBI',"ticiket_id",'Ticket_PBI'[ticket_id],"input_date",'Ticket_PBI'[input_date])2.Use the following DAX expression to create a measure
_input_date = CALCULATE(SELECTEDVALUE('Table'[input_date]) ,'Table'[input_date] <= MAX('Calendar_PBI'[Date]))3.Final output
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- simon_pbi_dataFrequent Visitor
Thanks a lot, now its work 🙂