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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dwel0120
Helper III
Helper III

Trying Again: Using Latest Date in table unless date selected

On my page I have a bar chart based on number of people by dates (daily capture) and then I have a table that represents the YoY change in the number of people. In order to get the latest date to show on the table visual, I created a calculated column that has a 1 on the latest date in the table and then I placed a filter on the table visual to 1. By doing this, I am unable to click on the dates on the bar chart. How would I write the measure to say something like -- show the latest date unless another date was selected? As of right now, the visual table on the bottom of the page has to be set at the latest date, so it doesn't sum up the entire data table. 

dwel0120_1-1669736116276.png

I want to be able to push on a date on the bar visual and it will populate the table visual below. Since I have the visual table filtered to latest date only, when I push on a date the table is blank.

dwel0120_0-1669736089870.png

I think I need a measure to put in the DailyYoY table that will say pick the latest date in the dataset unless there is a date that is selected. 

 

1 REPLY 1
v-tangjie-msft
Community Support
Community Support

Hi @dwel0120 ,

 

Based on your description, I recommend using the custom visual "Preselected Slicer".

Then we can create a measure.You can do this by using slicers to filter the largest dates by default.

 

Latest date =

var _maxdate = MAXX(ALL(Sample_Data),'Sample_Data'[Due Date])

return

IF(SELECTEDVALUE(Sample_Data[Due Date])=_maxdate,TRUE(),FALSE())

 

vtangjiemsft_0-1669795523565.png

Please refer to my PBIX file.

 

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.