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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
OfficeWitch
New Member

How to filter on the maximum of a slicer and a fixed value

I have a report with two slicers:

  • "Start Year" which represents the start year of a project
  • "Number of Years after Start": 0 will be the first year of Start, with both information about Sales and Forecast

A chart displays Sales and Forecast over the "Number of Years after Start". Sales and Forecast are available until (so including) 2023. See a simplified representation below. I also added an example of the data, it is in a single table. This data is purely to show the structure of it, and is not aligned to the chart.

 

Capture.JPGdata example.JPG

Projects can have different Start Years. When looking at the orange part in the chart, this data will only contain data for Project A. It looks like Sales has dropped, but the reason is in fact it is missing Sales/Forecast for Project B in those years (which isn't available yet).

I would like to filter out those years.

 

So if the maximum Start Year in the slicer is 2020, the maximum of the second slicer and the maximum number of years in the chart should be 3 (2023 - 2020).

Another example: when the selected maximum in the first slicer is 2018, the maximum of the second slicer and the maximum number of year shown in the chart should be 5 (2023 - 2018).

 

I made a measure with (2023 - maximum of the slicer of Start Year), and tried to compare that with the "Number of Years after Sales". Like in the last orange column in the data. I could then use this as a filter on my page. But unfortunately I can't make it work like intended. But I have no clue as of why it doesn't.

 

I can't find a solution on the internet that helps me with this problem, hope you can help. Thanks!

1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.