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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Margin % difference for 2 years

Hi,

 My margin % is from profit divide sales. How do I calcualate the margin % difference for both year? There is subtotal in the formatting, but I want difference instead. 

Sharene_0-1644557605021.png

 

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You want to replace subtotal with the result you want. You can use the ISINSCOPE function.

Measure = IF(ISINSCOPE('Table'[Year]),[Percentage],[Difference])

vstephenmsft_0-1645177015247.png

The example I attached is relatively simple, you can refer to it.

 

 

Best Regards,

Stephen Tao

 

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

View solution in original post

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You want to replace subtotal with the result you want. You can use the ISINSCOPE function.

Measure = IF(ISINSCOPE('Table'[Year]),[Percentage],[Difference])

vstephenmsft_0-1645177015247.png

The example I attached is relatively simple, you can refer to it.

 

 

Best Regards,

Stephen Tao

 

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

ALLUREAN
Solution Sage
Solution Sage

Hi, @Anonymous 

Try creating a measure like:

 

YoY Variance Margin =
VAR __PREV_YEAR = CALCULATE([YourMargin%]), DATEADD('Date'[Date], -1, YEAR)

//Replace 'Date'[Date] by your date column coming from Calendar table

VAR __CURR_YEAR = [YourMargin%] --Selected by slicer
RETURN
__CURR_YEAR - __PREV_YEAR

 

It is suggested that you have date table and using date from there 'Date'[Date]

[YourMargin%] - you should replace it by your Margin measure calculation

 




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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