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

Dynamically Comparing Two Years

So I want to dynamically choose two years I want to compare for a measure, in my case - profit.
I made a DAX measure to calculate profit for A year, for example:

Profit LY = CALCULATE([Profit]; Year[Year] = 2018 )

but I want to calculate the profit for a year I pick via a slicer. Is that achievable?

1 REPLY 1
ibarrau
Super User
Super User

Hi. It is not something I would recommend to have a measure from slicer, but you can solve this with SELECTEDVALUE.


Here is some doc:

https://docs.microsoft.com/en-us/dax/selectedvalue-function

https://dax.guide/selectedvalue/

 

Regards,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

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.

Top Solution Authors