Showing results for 
Search instead for 
Did you mean: 
hernannor Frequent Visitor
Frequent Visitor

Sales of SamePeriodLastYear dissapears when filtering

Hi! I need to replicate this graphic where I have one line with the sales of this month until today and another with sales of the previous year. But when I choose a specfic month, the line of the sales of the previous year dissapear because of that filter. How can I fix this?




Capture.PNGThis is what I have to replicateCapture.GIFThis is my current graphic but When I filter the below line dissapears




Community Support Team
Community Support Team

Re: Sales of SamePeriodLastYear dissapears when filtering

@hernannor ,


You may add a separate table for Slicer, apply virtual relationship in DAX measure and then take advantage of Visual level filters.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hernannor Frequent Visitor
Frequent Visitor

Re: Sales of SamePeriodLastYear dissapears when filtering

Hi @v-chuncz-msft , 


I tried many things but it´s not working. ´ll explain better:


What I need is to have the sales of an year and the previous year day by day. I need to filter only one month for ex may and I need the sales of the same month previous year but without filtering that previous year.


This are my current sales of 2019

QP RT = calculate(sum(QVGFTRFDB[Q P]);filter(ALLSELECTED(QVGFTRFDB);QVGFTRFDB[fecha_tf]<=max(QVGFTRFDB[fecha_tf])))


This is my formula for the sales of same month last year 2018:

QP LY RT = calculate([QP LY];filter(ALLSELECTED(QVGFTRFDB);QVGFTRFDB[fecha_tf]<=MAX(QVGFTRFDB[fecha_tf])))
where QP LY is 
calculate(sum(QVGFTRFDB[Q P]);SAMEPERIODLASTYEAR('Calendar'[Date]))

Helpful resources

Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 6 members 1,945 guests
Please welcome our newest community members: