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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
neelofarshama
Post Partisan
Post Partisan

DAX for subtraction of categories

Hi,

I have a report with matrix calculations as shown below. My total(EBITDA) is showing up wrong values. 30,080-32,342=-2262 but its showing -2271

neelofarshama_0-1615372385073.png

DAX used for 

1)FY2020 Period Actual : 

FY2020 Period Actual = VAR x = -TOTALMTD([Total$],SAMEPERIODLASTYEAR(Append1[Date].[Date]))/1000
Return
if (
HASONEFILTER(AcctCategory[Acct Type]),
x,
sumx(AcctCategory,-TOTALMTD([Total$],SAMEPERIODLASTYEAR(Append1[Date].[Date]))/1000))
2)FY2021 YTD Actual
FY2021 YTD Actual = VAR x = -TOTALYTD([Total$],Append1[Date].[Date])/1000
Return
if (
HASONEFILTER(AcctCategory[Acct Type]),
x,
sumx(AcctCategory,-TOTALYTD([Total$],Append1[Date].[Date])/1000))
3)PY YTD Actual
PY YTD Actual = VAR x = -TOTALYTD([Total$],SAMEPERIODLASTYEAR(Append1[Date].[Date]))/1000
Return
if (
HASONEFILTER(AcctCategory[Acct Type]),
x,
sumx(AcctCategory,-TOTALYTD([Total$],SAMEPERIODLASTYEAR(Append1[Date].[Date]))/1000))
 
Here Append1 is my table and Date is my Date column
Total$ is sum(Actual Amount)
AcctCategory is table2 which has Acct Type as Revenue and Expense as categories.
Please help.
Thanks in Advance,
Neelofer Shama
2 REPLIES 2
amitchandak
Super User
Super User

@neelofarshama , is EBITA is an ACC TYPE , as there is no + button near to it I doubt. Because formula using hasonevalue might have different calculation; if this is not an ACC type

No EBITDA is just total I have renamed Total to EBITDA

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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