Skip to content

Instantly share code, notes, and snippets.

Avatar

HansPeterPfister

View GitHub Profile
View join_case_insensitive.M
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"
View RLS_Sales_Profit
Sales Profit = If (
[RLS_Measure]=0;
BLANK();
SUM(FactResellerSales[SalesProfit]) * [RLS_Measure]
)
View RLS_Profit_pct
Profit pct = If (
[RLS_Measure]=0;
BLANK();
DIVIDE([Sales Profit]*100;[Sales Amount])
* [RLS_Measure]
)
View RLS_Product_Cost
Product Cost = if(
[RLS_Measure]=0 ;
BLANK();
sum(FactResellerSales[TotalProductCost]) * [RLS_Measure]
)
View RLS_Hilfsmeasure
RLS_Measure = LOOKUPVALUE(
RLS[ShowMeasures];
RLS[User];USERNAME()
)
View RLS_Hide_Measures
if(
maxx(
Filter(RLS,
RLS[User]=USERNAME()
)
,[Role]) = "Board" ||
maxx(
Filter(RLS,
RLS[User]=USERNAME()
)
View RLS_Employee_with_Manager_Access
if(
maxx(
Filter(RLS,
RLS[User]=USERNAME()
)
,[Role]) = "Board" ||
maxx(
Filter(RLS,
RLS[User]=USERNAME()
)
View Umsatz.dax
Umsatz = CALCULATE(
SUM(Umsatzliste[Wert])
)
View Umsatz Plan.dax
Umsatz Plan =
CALCULATE(
sum(Umsatzliste[Wert]);
Filter(Umsatzliste;Umsatzliste[Szenario]="Plan");
Filter(Kalender;Kalender[relatives Jahr]>0)
)
View Umsatz Plan aktuelles Jahr.dax
Umsatz Plan aktuelles Jahr =
CALCULATE(
sum(Umsatzliste[Wert]);
Kalender[relatives Jahr]=0
)