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
PwrBI01
Post Patron
Post Patron

Apply a Year-Over-Year variation in just one year with multiple years selected

Hi guys,

 

I have created the following table on Power BI:

Imagen2.png

 

And I would like to just show the variation of 2019 over 2018, so the table I want is the next one:

 

Imagen1.png

 

Is there a way to do it?

 

The Power BI file where you can see it is https://www.dropbox.com/s/spl6zkv56y9slpi/Power%20BI%20problem.pbix?dl=0

 

Thanks in advance.

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @PwrBI01 ,

 

Create a new table with the measures you need:

Measure

Measure

Variation

 

then add the following measure:

Measure2 =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Filter'[Measure] ) = "Measure", [Measure],
    IF (
        SELECTEDVALUE ( 'Calendar'[Year] )
            = MAXX ( ALLSELECTED ( 'Calendar'[Year] ), 'Calendar'[Year] )
            && SELECTEDVALUE ( 'Filter'[Measure] ) = "Variation",
        FORMAT ( [Variation], "##%" )
    )
)

 

Now add the columns from the previous table haas an hierarchy in the year column.

 

sss.png


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @PwrBI01 ,

 

Create a new table with the measures you need:

Measure

Measure

Variation

 

then add the following measure:

Measure2 =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Filter'[Measure] ) = "Measure", [Measure],
    IF (
        SELECTEDVALUE ( 'Calendar'[Year] )
            = MAXX ( ALLSELECTED ( 'Calendar'[Year] ), 'Calendar'[Year] )
            && SELECTEDVALUE ( 'Filter'[Measure] ) = "Variation",
        FORMAT ( [Variation], "##%" )
    )
)

 

Now add the columns from the previous table haas an hierarchy in the year column.

 

sss.png


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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