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
Anonymous
Not applicable

Issue with Last N Months

I have data for last 2 months of a year 2018.I have created all the necessary measures and columns as well as tables following this tutorial http://sqljason.com/2018/03/display-last-n-months-selected-month-using-single-date-dimension-in-powe....This is my dashboard.
ted1.PNG

but when i am choosing the date as August 2018 and selecting the slider to show the data for last 2( or any number) months then i am not getting the required result. This is the measure i am using 

 

Scan (last n months) = 
CALCULATE (
    COUNT('Scan'[Data ID]),
    DATESINPERIOD ('Date'[Date],MAX('Date'[Date]),-[N Value],MONTH )
)

 

 

No data for previous months for August 2018No data for previous months for August 2018

No data for previous months of August 2018

3 REPLIES 3
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

We think the problem may be with the filed used in slicer.

Please try using ‘Date’ table’s [monthyear] to create a slicer.

Here is an simple,

 

20.png

 

Before this, we need to create a relationship between date table and Scan table.

 

21.png

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?


Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Could you please share the pbix file with me 

Hi @Anonymous ,

 

Our sample pbix is at the end of our previous reply.


Best regards,

 

Community Support Team _ Dong Li
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.