Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
simon_pbi_data
Regular Visitor

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)

simon_pbi_data_0-1714415864996.png

 

Table Calendar_PBI: calendar_date (date) 

simon_pbi_data_1-1714416030264.png

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

MicrosoftTeams-image (10).png


1 ACCEPTED SOLUTION
v-zhouwen-msft
Community Support
Community Support

Hi @simon_pbi_data ,

The Table data is shown below:

vzhouwenmsft_0-1714443386303.png

vzhouwenmsft_1-1714443402767.png

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])

vzhouwenmsft_2-1714443451442.pngvzhouwenmsft_3-1714443467301.png

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

vzhouwenmsft_4-1714443532190.png

vzhouwenmsft_5-1714443556339.png

vzhouwenmsft_6-1714443588202.png

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.

 

View solution in original post

2 REPLIES 2
v-zhouwen-msft
Community Support
Community Support

Hi @simon_pbi_data ,

The Table data is shown below:

vzhouwenmsft_0-1714443386303.png

vzhouwenmsft_1-1714443402767.png

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])

vzhouwenmsft_2-1714443451442.pngvzhouwenmsft_3-1714443467301.png

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

vzhouwenmsft_4-1714443532190.png

vzhouwenmsft_5-1714443556339.png

vzhouwenmsft_6-1714443588202.png

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.

 

Thanks a lot, now its work 🙂

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors