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
admin11
Memorable Member
Memorable Member

P&L Table how to compute GP% for LYTD ? ( YTD column no issue )

Hi All

 

I have below expression  :-

 

PnL CY = SWITCH(SELECTEDVALUE('_PnL_Var'[PnL_Var]),
"2_COGS",[AMOUNT_COGS],
"1_REV", [AMOUNT_REV_N],
"3_OTH", [AMOUNT_OTH_IN],
"4_EXP", [AMOUNT_EXP],
"5_NET_P",[AMOUNT_NP_],
"6_GPM",[AMOUNT_GP],
"7_NPM",[AMOUNT_NP]
)
 The above expression create below report table , which the 6_GPM wrong , it should be 0.38 , but it return 0.45
 
admin11_0-1648507569405.png

My 6_GPM expression as below :-

 
AMOUNT_GP = DIVIDE([AMOUNT_REV_N]+[AMOUNT_COGS],[AMOUNT_REV_N])
 
Can some one share with me how to make the GP% display correct value ?
 
Hint :- For YTD column , it can display correct GP% , But LYTD it display wrongly GP% ,
Paul Yeo
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@admin11 , for LYTD you can try measure like

 

Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@admin11 , for LYTD you can try measure like

 

Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs

@amitchandak 

Thank you for answer my post.

 
Also thank you for propose expression for LYTD REV .
 
I have check my LYTD REV expression as below :-
_LYTD_REV =
var _max = date(year(today())-1,month(today()),day(today()))
return
TOTALYTD
(
('GL'[AMOUNT_REV]),
dateadd('DATE'[Date],
-1,year),
'DATE'[Date]<=_max
)
 
it can return correct LYTD amount on Revenue and COGS. But i get the GP% wrong value. for YTD no issue. So must be the below cause the issue right ?
 
AMOUNT_GP = DIVIDE([AMOUNT_REV_N]+[AMOUNT_COGS],[AMOUNT_REV_N])
 
Paul

Helpful resources

Announcements
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.