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
sbm_shubham
Frequent Visitor

Comparing Current year sales with respective last year sales but slicer not allowing to show PYsales

I wanted to show historic data on my report using slicer, but once user filter out data using slicer CY sales is visible not PY sales.

How to avoid slicer to filter PY sales on table.
Thanks,

 

3 REPLIES 3
Thejeswar
Resident Rockstar
Resident Rockstar

Hi @sbm_shubham ,

Let say the below is your CY sales measure

 

CYSales = CALCULATE([Sales], Calendar[Year] = YEAR(TODAY()))

then your PYSales will be

PYSales = CALCULATE([Sales], Calendar[Year] = YEAR(TODAY()) - 1) 

This should give you the CYSales and PYSales even if some filter is going to be applied.

 

You can also use the Previous Year function for this. 

The Below screenshot show two tables (with and without filter on year applied)

Thejeswar_0-1696856815022.png

 

 

You can also share the DAX that you are using for getting better help from the community

Regards,

sbm_shubham
Frequent Visitor

@JulieBunavicz 
Thanks for quick reply.
I don't want to show only difference on the visual but the page having Fiscal Year slicer and that is not allowing visual to show sale of previous year.

 

JulieBunavicz
New Member

Maybe this is helpful https://youtu.be/GpeDlR81YmA?si=T2MwDj6cjhlw8Ayp

 

Kind regards,

 

Julie Bunavicz

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.