Forum Discussion

simon_pbi_data's avatar
simon_pbi_data
Frequent Visitor
2 years ago
Solved

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'.

  1. 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.
  2. 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'.

  1. 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:




  • Anonymous's avatar
    Anonymous
    2 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 table

    Table = 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

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi simon_pbi_data ,

    The Table data is shown below:

    Please follow these steps:
    1. Use the following DAX expression to create a table

    Table = 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.