Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
thoma4sl
Regular Visitor

What would the DAX formula be if I wanted to have these calculation on a measure.

I want to create a measure that would use another measure that is the variance of salesvalues from 2019 and 2020 using the following filters. Not sure how that DAX command would look like. 

 

 

thoma4sl_0-1626982882030.png

 

2 REPLIES 2
daxer-almighty
Solution Sage
Solution Sage

The most important observation about your model is that it's wrong and you should change it. Hard-coding the names of years in your measures or fields is a clear sign you should really try to make an effort and learn the rules of data modeling for Power BI. If you don't do this... well, you'll be in trouble very soon and rather sooner than later.

Mohammad_Refaei
Solution Specialist
Solution Specialist

NewMeasure =
IF (
    AND ( [SALES_VALUE for 2019] <> 0, [SALES_VALUE for 2020] <> 0 ),
    [SALES_VALUE for 2020] - [SALES_VALUE for 2019]
)

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.