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
NJ81858
Helper IV
Helper IV

Different Dates for different visuals

Hello,

 

I am putting together a metrics report and I am having some issues with dates. I have 5 visuals that I want to display the data between certain dates, but the 6th visual I only want to display the data for the last date that is selected. For example:

 

The user wants to see data for the range of January through July. I want 5 visuals to show all numbers for that range, and the 6th I only want to display July data. 

 

Is this something that is possible? Also I apologize, I cannot share my .pbix file as it contains sensitive data. 

 

Thank you in advance!

1 ACCEPTED SOLUTION

Hi @NJ81858 ,

 

Yes, it's possible. 

You need a calendar table. You can create it using DAX.

Calendar = CALENDAR(DATE(2022,1,1),DATE(2022,12,31))

vstephenmsft_0-1668067958388.png

Modify the two measures.

Measure = IF(MAX('Table'[Date])>=MIN('Calendar'[Date])&&MAX('Table'[Date])<=MAX('Calendar'[Date]),1)
Measure 2 = IF(MONTH(MAX('Table'[Date]))=MONTH(MAX('Calendar'[Date])),1)

Based on the previous solution1, add a slicer of a calendar table to filter the date range.

vstephenmsft_1-1668068275416.png

 

 

 

Best Regards,

Stephen Tao

 

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

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @NJ81858 ,

 

Solution 1:

You can use the filters to filter. In addition to fields that can be added to filter, measures can also be added.

Measure = IF(MAX('Table'[Date])>=DATE(2022,1,1)&&MAX('Table'[Date])<=DATE(2022,7,31),1)

After you add the measure into the visual-level filter, and set up show items when the value is 1, you'll see data for the range of January through July. And this is the visual 1. The other four visuals can also be set up like this.

vstephenmsft_0-1667527316524.png

 

About the visual 6, you can create another visual below and add it into the visual-level filter of visual 6.

Measure 2 = IF(MONTH(MAX('Table'[Date]))=7,1)

vstephenmsft_1-1667527517127.png

 

Solution 2:

You can change the interaction of the visuals. You can learn about it from the following document:

Change how visuals interact in a report - Power BI | Microsoft Learn

vstephenmsft_3-1667527907319.png

vstephenmsft_2-1667527846643.png

 

 

Best Regards,

Stephen Tao

 

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

@v-stephen-msft is there a way to make the first solution dynamic? So that is the user wants to see different months then the visual that shows the last month will change as well?

Hi @NJ81858 ,

 

Yes, it's possible. 

You need a calendar table. You can create it using DAX.

Calendar = CALENDAR(DATE(2022,1,1),DATE(2022,12,31))

vstephenmsft_0-1668067958388.png

Modify the two measures.

Measure = IF(MAX('Table'[Date])>=MIN('Calendar'[Date])&&MAX('Table'[Date])<=MAX('Calendar'[Date]),1)
Measure 2 = IF(MONTH(MAX('Table'[Date]))=MONTH(MAX('Calendar'[Date])),1)

Based on the previous solution1, add a slicer of a calendar table to filter the date range.

vstephenmsft_1-1668068275416.png

 

 

 

Best Regards,

Stephen Tao

 

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

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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