0% found this document useful (0 votes)
64 views7 pages

Total Explication Power BI

The document contains formulas for calculating total volume, total quantities, and quantities for a strategy plan based on account type, browse depth, and lookup values. It uses SUMX, VAR, SWITCH, LOOKUPVALUE, and IF functions to determine sign and return final results.

Uploaded by

Mohamed El Heddi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views7 pages

Total Explication Power BI

The document contains formulas for calculating total volume, total quantities, and quantities for a strategy plan based on account type, browse depth, and lookup values. It uses SUMX, VAR, SWITCH, LOOKUPVALUE, and IF functions to determine sign and return final results.

Uploaded by

Mohamed El Heddi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Total_Volume = CALCULATE( SUM ( StrategyPlan[Volume])

Total_Qtes =
VAR Val =
SUMX (
SUMMARIZE (
StrategyPlan,
Account[AccountType]
),
VAR SignToUse =
IF ( Account[AccountType] IN { "Charges", "Taxation" }, -1, +1 )
VAR Amount = [Total_Volume]
RETURN
Volume * SignToUse
)
VAR AccountShowRow = [AccountBrowseDepth] <= [AccountRowDepth]
VAR EntityShowRow = [EntityBrowseDepth] <= [EntityRowDepth]
VAR Result = IF ( AccountShowRow && EntityShowRow, Val )
RETURN
Result

Qtes =
VAR BrowseLevel = [AccountBrowseDepth]
VAR AccountName =
SWITCH (
BrowseLevel,
1, SELECTEDVALUE ( Account[Level1] ),
2, SELECTEDVALUE ( Account[Level2] ),
3, SELECTEDVALUE ( Account[Level3] ),
4, SELECTEDVALUE ( Account[Level4] )
)
VAR AccountType =
LOOKUPVALUE ( Account[AccountType], Account[AccountName], AccountName )

VAR ValueToShow = [Total_Qtes]


VAR Result =
IF ( AccountType IN { "Charges", "Taxation" }, -1, +1 ) * ValueToShow

RETURN
Result
Voici mon calcul : IF( table[operationType] = "capture" || table[operationType] =
"payment" ,  CALCULATION ( SUM( table[amount] ; execCodes [code] = "0";
table[operationType] = "capture" || table[operationType] = "payment" ) )

You might also like