let
// --- Function segment ---
// Author: Imran Haq (PBI Queryous)
output = //fnFunctionName
(input as list) as table =>
let
step1 = "PowerQueryFunctionsHere"
in
step1
let
Source =
let
func = // fnPowerTrim
let
input = (text as text, optional char_to_trim as text) =>
let
char = if char_to_trim = null then " " else char_to_trim,
Measure | CFYTD =
// current fiscal year to date of [BaseMeasure]
VAR _ytd =
CALCULATE ( MAX ( _Dates[LatestMTD] ), REMOVEFILTERS () )
VAR _result =
CALCULATE (
[BaseMeasure],
KEEPFILTERS ( _Dates[Date] <= _ytd )
// , Dates[IsCFY] = TRUE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Grey Theme", | |
"dataColors": [ | |
"#3053FF", | |
"#A7B6FF", | |
"#70ACD6", | |
"#70C8BB", | |
"#AFC280", | |
"#BB7C7C", | |
"#FBD188", |
let
function1 = // fnGetCalendarMonth
/* ------------------------------
Author: Imran Haq - PBI QUERYOUS
Description: Get Calendar Month Number from Fiscal Period Number
let
customFunction = // fnReplaceBlanksRemoveNulls
/* ------------------------------
Author: Imran Haq - PBI QUERYOUS
Description: fnReplaceBlanksRemoveNulls
---------------------------------*/
// 1.0: invoke function & define parameter inputs
let
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Day1 Answer = | |
var _result = | |
MAXX( | |
TOPN( 1, // return top 1 | |
VALUES( tournaments_standings[team_name] ), // iterate over tournaments_standings table | |
CALCULATE( | |
COUNTROWS( tournaments_standings ), // count all rows in table | |
tournaments_standings[position] = 1 // where position is first place |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host Wins = | |
FILTER( | |
SELECTCOLUMNS( | |
tournaments, | |
"Team", [winner], | |
"Host Win", [host_won] | |
), | |
[Host Win] = 1 | |
) |
OlderNewer