.Age = INT ( YEARFRAC ( [birthday].[Date], TODAY (), 1 ) )
Monday, January 23, 2023
DAX - Calculo de tempo , age, idade
Monday, December 19, 2022
DAX - Dynamic Field Parameter Grouping
1 - Create Dynamic Table (Modeling -> New Parameters -> Fields )
Wednesday, October 26, 2022
Power Query - Create Rows Interval Dates (TO - FROM )
let
Source = DIM_SAP_Centro_CustoTXT,
#"Changed Type1" = Table.TransformColumnTypes(Source,{{"DATEFROM", type date}, {"DATETO", type date}}),
#"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each List.Dates([DATEFROM], Number.From([DATETO]-[DATEFROM])+1, #duration(1, 0, 0, 0))),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
#"Changed Type2" = Table.TransformColumnTypes(#"Expanded Custom",{{"Custom", type text}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type2", each Text.StartsWith([Custom], "01")),
#"Added Custom Column" = Table.AddColumn(#"Filtered Rows", "AnoMes", each Text.Combine({Date.ToText(Date.From([Custom]), "yyyy"), Date.ToText(Date.From([Custom]), "MM")}), type text),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom Column",{"AnoMes", "COSTCENTER", "TXTSH", "DATETO", "DATEFROM"})
in
#"Removed Other Columns"
Wednesday, August 24, 2022
Power Query or SQL - CALCULATE DAY BETWEEN DATES
Power Query:
Table.AddColumn(#"Changed Type1", "Subtraction", each Duration.Days([dt_Aberto] - [dt_Previsao]), Int64.Type)
SQL:
SELECT DATEDIFF(year, '2005-12-31 23:59:59.9999999', '2006-01-01 00:00:00.0000000'); SELECT DATEDIFF(quarter, '2005-12-31 23:59:59.9999999', '2006-01-01 00:00:00.0000000'); SELECT DATEDIFF(month, '2005-12-31 23:59:59.9999999', '2006-01-01 00:00:00.0000000'); SELECT DATEDIFF(dayofyear, '2005-12-31 23:59:59.9999999', '2006-01-01 00:00:00.0000000'); SELECT DATEDIFF(day, '2005-12-31 23:59:59.9999999', '2006-01-01 00:00:00.0000000'); SELECT DATEDIFF(week, '2005-12-31 23:59:59.9999999', '2006-01-01 00:00:00.0000000'); SELECT DATEDIFF(hour, '2005-12-31 23:59:59.9999999', '2006-01-01 00:00:00.0000000'); SELECT DATEDIFF(minute, '2005-12-31 23:59:59.9999999', '2006-01-01 00:00:00.0000000'); SELECT DATEDIFF(second, '2005-12-31 23:59:59.9999999', '2006-01-01 00:00:00.0000000'); SELECT DATEDIFF(millisecond, '2005-12-31 23:59:59.9999999', '2006-01-01 00:00:00.0000000'); SELECT DATEDIFF(microsecond, '2005-12-31 23:59:59.9999999', '2006-01-01 00:00:00.0000000');
Tuesday, July 19, 2022
Tabular Editor Advanced = Search Filter sources
:Expression.ToUpper().Contains("APO")
:Name.EndsWith("Apo")
:Name.ToUpper().EndsWith("KEY")
Sunday, May 29, 2022
Wednesday, May 18, 2022
DAX - RANK
.Rank_ERRADO =
IF( HASONEVALUE(RFM_SAP_FAT_Vendas_py[CustomerID]),
RANKX(ALL (RFM_SAP_FAT_Vendas_py[CustomerID]), RFM_SAP_FAT_Vendas_py[.RankSum]))
.Rank2_CERTO =
IF( HASONEVALUE(RFM_SAP_FAT_Vendas_py[CustomerID]),
RANKX(ALL (RFM_SAP_FAT_Vendas_py[CustomerID]), RFM_SAP_FAT_Vendas_py[.RankSum]))
.RankSum = SUM(RFM_SAP_FAT_Vendas_py[TotalQtd])
OBS:
.Rank2_CERTO e .RankSum são Measures
.Rank_ERRADO é Column Calc
SQL - Query Analytics Basic
SELECT Nome_Produto, ROUND(MIN(Valor_Venda), 2) AS Valor_Minimo, ROUND(MAX(Valor_Venda), 2) AS Valor_Maximo, ROUND(AV...
-
There are two points to be evaluated: 1. If you want to discard the errors In this case, just run: #"Removed errors" = Table.Re...
-
====================================================== CSV: let Source = SharePoint.Files("https://site", [ApiVersion = 15]), ...
-
Top Power BI Visualizations Types 0. Charticulator https://charticulator.com/ Here are the chart types in Power BI: 1. Area Charts The ar...