Skip to content

Instantly share code, notes, and snippets.

View HansPeterPfister's full-sized avatar

HansPeterPfister

View GitHub Profile
let
Quelle = Table.AddColumn(Trans, "Merge",
(case_insensitive) => Table.SelectRows(Dept,
each Text.Upper([Name]) = Text.Upper(case_insensitive[Name]))),
#"Expanded Merge" = Table.ExpandTableColumn(Quelle, "Merge", {"Name", "Dept"}, {"Emp.Name", "Emp.Dept"})
in
#"Expanded Merge"
Sales Profit = If (
[RLS_Measure]=0;
BLANK();
SUM(FactResellerSales[SalesProfit]) * [RLS_Measure]
)
Profit pct = If (
[RLS_Measure]=0;
BLANK();
DIVIDE([Sales Profit]*100;[Sales Amount])
* [RLS_Measure]
)
Product Cost = if(
[RLS_Measure]=0 ;
BLANK();
sum(FactResellerSales[TotalProductCost]) * [RLS_Measure]
)
RLS_Measure = LOOKUPVALUE(
RLS[ShowMeasures];
RLS[User];USERNAME()
)
if(
maxx(
Filter(RLS,
RLS[User]=USERNAME()
)
,[Role]) = "Board" ||
maxx(
Filter(RLS,
RLS[User]=USERNAME()
)
if(
maxx(
Filter(RLS,
RLS[User]=USERNAME()
)
,[Role]) = "Board" ||
maxx(
Filter(RLS,
RLS[User]=USERNAME()
)
Umsatz = CALCULATE(
SUM(Umsatzliste[Wert])
)
Umsatz Plan =
CALCULATE(
sum(Umsatzliste[Wert]);
Filter(Umsatzliste;Umsatzliste[Szenario]="Plan");
Filter(Kalender;Kalender[relatives Jahr]>0)
)
Umsatz Plan aktuelles Jahr =
CALCULATE(
sum(Umsatzliste[Wert]);
Kalender[relatives Jahr]=0
)