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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ttcalendar
Frequent Visitor

DAX Measure If Row header is then

Hi,

 

I have a matrix table where there are 4 row headers for a P&L report. I've been looking for a measure where it would calculate "Global Var% of LY" based on the table maxtrix row name. 

The current measure is [Global Total Value LY]-[Global Total Value TY])/[Global Total Value LY].

I'm looking for something that will say IF Row name = TOTAL NEW SALES then

[Global Total Value TY]-[Global Total Value LY])/[Global Total Value TY] otherwise for the other headers COST OF SALES, DIRECT EXPENSES AND OVERHEADS return [Global Total Value LY]-[Global Total Value TY])/[Global Total Value LY].
 
Essentially I need a different calculation to occur for the row name TOTAL NEW SALES.
 
Is this possible?

 

PBIDesktop_NURo24sTNP.png

7 REPLIES 7
Sandy_P
New Member

I am encountering the same problem. Has anyone figured this out yet?

v-xicai
Community Support
Community Support

Hi  @ttcalendar  ,

 

Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

amitchandak
Super User
Super User

@ttcalendar ,

Refer these can help

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

 

Assuming formula is ([Global Total Value LY]-[Global Total Value TY])/[Global Total Value LY]

Better use : divide([Global Total Value LY]-[Global Total Value TY]),[Global Total Value LY])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
VijayP
Super User
Super User

@ttcalendar 

"[Global Total Value TY]-[Global Total Value LY])/[Global Total Value TY] otherwise for COST OF SALES, DIRECT EXPENSES AND OVERHEADS return [Global Total Value LY]-[Global Total Value TY])/[Global Total Value LY]." 

 

The above statemet is bit confusing. just rephrase it so that I can help. I work PNL in Power bI




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Apologise if this wasn't clear, I have amended my post.

az38
Community Champion
Community Champion

@ttcalendar 

how should look like value in row  TOTAL NEW SALES - Sales?


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
az38
Community Champion
Community Champion

Hi @ttcalendar 

If i understand you correct in the most common case you can try a measure like

= IF(MAX('Table'[Row level1]) = 'TOTAL NEW SALES', [Global Total Value TY]-[Global Total Value LY])/[Global Total Value TY], [Global Total Value LY]-[Global Total Value TY])/[Global Total Value LY])

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.