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
ptrex
New Member

Full Last Year - non context related

Hi all,

 

I am struggling the get this working :

Comparing current month / current year versus ALL months / Last year using a slider control.

So if I have 1 Slider for Year and 1 for Month. 

 

And I select JAN 2018 current year. I wand to see ALL 12 months last year.

 

Ex. CY / Month                 LY / All months

Jan         100                       Jan         80

Feb        120                       Feb        75

                                            Mar       110

                                            APR        95

                                            ...

                                            DEC       75

 

So the LY selection needs to be NON CONTEXT related to the current year / month selection.

 

I tried many options like ; SAMEPERIODLASTYEAR / TOTALYTD / DATESYTD / etc but no success ?

Any help is appreciated...

1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @ptrex,

 

If I understand you correctly, you should be able to follow steps below to get the expected result. Smiley Happy

 

1. Use the formula below to create a new measure.

Is Last Year = IF ( YEAR ( MAX ( 'Date'[Date] ) ) = YEAR ( TODAY () ) - 1, 1, 0 )

2. Use the new created measure to apply a visual level filter([Is Last Year] is 1) on the Table visual to show data for full last year.

 vlf1.PNG

3. Select the Year Slicer, go to Format tab, and click on Edit interactions.

 ei1.PNG

4. Select None on the Table visual which you use to show data for full last year.

 r1.PNG

5. Repeat step 3 and 4 for Month Slicer.

 

Regards

View solution in original post

2 REPLIES 2
v-ljerr-msft
Employee
Employee

Hi @ptrex,

 

If I understand you correctly, you should be able to follow steps below to get the expected result. Smiley Happy

 

1. Use the formula below to create a new measure.

Is Last Year = IF ( YEAR ( MAX ( 'Date'[Date] ) ) = YEAR ( TODAY () ) - 1, 1, 0 )

2. Use the new created measure to apply a visual level filter([Is Last Year] is 1) on the Table visual to show data for full last year.

 vlf1.PNG

3. Select the Year Slicer, go to Format tab, and click on Edit interactions.

 ei1.PNG

4. Select None on the Table visual which you use to show data for full last year.

 r1.PNG

5. Repeat step 3 and 4 for Month Slicer.

 

Regards

It took me a while before I understood the concept of Visual Interactions.

 

But after watching this video it was clear ...

 

https://docs.microsoft.com/en-us/power-bi/service-reports-visual-interactions

 

After applying you solution to my problem it was spot on 🙂

 

Thanks a lot

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.