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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
reshmasara
Helper I
Helper I

Last n months on user input

Hi everyone

 

I have a complaints table with complaint transactions along with many attributes about the complaint including a posting date and a resolution date.

 

I'm trying to create two graphs. One showing complaints by posting date and another showing complaints by resolution date. I want to be able to pass the number of months to show on the graphs based on user input. So, let's say the user selects 5, the first graph will show complaints posted in the last 5 months and the second will show the complaints resolved it the last 5 months.

 

I don't want to use visual level slicers because that panel is hidden in the published version. And using relative date slicers filters posting date based on resolution date or vice versa, which is also not correct. 

 

Any thoughts?

Screenshot 2022-11-28 110924.png

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

Hi @reshmasara ,

 

Create an independent calendar table and create inactive relationships between tables.

Then create two measures like below:

 

 

 

Measure1 = CALCULATE(MAX('Table'[date1]),USERELATIONSHIP('Table'[date1],'calendar'[date]))

Measure2 = CALCULATE(MAX('Table'[date2]),USERELATIONSHIP('Table'[date1],'calendar'[date]))

 

 

 

Place these two measures separately into the corresponding visual filters to set the value = "is not blank".

At last, set calendar date as filter in visuals.

PBIX attached.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

1 REPLY 1
v-jayw-msft
Community Support
Community Support

Hi @reshmasara ,

 

Create an independent calendar table and create inactive relationships between tables.

Then create two measures like below:

 

 

 

Measure1 = CALCULATE(MAX('Table'[date1]),USERELATIONSHIP('Table'[date1],'calendar'[date]))

Measure2 = CALCULATE(MAX('Table'[date2]),USERELATIONSHIP('Table'[date1],'calendar'[date]))

 

 

 

Place these two measures separately into the corresponding visual filters to set the value = "is not blank".

At last, set calendar date as filter in visuals.

PBIX attached.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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