Monday, February 27, 2023

Power Query - Convert 18-digit LDAP/FILETIME timestamps

 Convert 18-digit LDAP/FILETIME timestamps


Power Query:

  #"Added custom" = Table.TransformColumnTypes(Table.AddColumn(#"Replaced Value9", ".DateLastLogon", each [lastLogon] / 864000000000), {{".DateLastLogon", type datetime}}),

  #"Added custom2" = Table.TransformColumnTypes(Table.AddColumn(#"Added custom", ".DateLastLogonTimestamp", each [lastLogonTimestamp] / 864000000000), {{".DateLastLogonTimestamp", type datetime}}),

  #"Added custom3" = Table.TransformColumnTypes(Table.AddColumn(#"Added custom2", ".DateAccountExpires", each [accountExpires] / 864000000000), {{".DateAccountExpires", type datetime}}),

  

Font help me:

https://www.epochconverter.com/ldap




864000000000

80589246768


20000000000

1676040067

Tuesday, February 7, 2023

Power BI - Motor de Alarmisticas via Visual Table (Python Azure DAX PBIX)

 Step by step para buscar dados de dentro de um Visual Table 

  1. Criar PBIX e gerar a tabela com as informações minimas ( 

    E-mail 
    1. Valor a Monitorar 
    2. Valor Range In 
    3. Valor Range out) 
  2. Gerar query via PBIX 
  3. Executar/Testar query via DaxStudio 
  4. Ajustar query JSON para execução REST API  
    1. Replace:  " por \"  
  5. Testar query via REST API 
 

 

 

 

 

ID 

Descrição 

1 

 

2 

 

 

3 

 

4 

{ 

  "queries": [ 

    { 

      "query":  

" 

DEFINE 

  VAR __DS0Core =  

    SUMMARIZECOLUMNS( 

      ROLLUPADDISSUBTOTAL( 

        ROLLUPGROUP('DIM_Alarmes'[Email], 'DIM_Alarmes'[Status]), \"IsGrandTotalRowTotal\" 

      ), 

      \"v_Valores\", 'DIM_Alarmes'[.Valores], 

      \"v_qtdRegs\", 'DIM_Alarmes'[.qtdRegs] 

    ) 

  

  VAR __DS0PrimaryWindowed =  

    TOPN(502, __DS0Core, [IsGrandTotalRowTotal], 0, 'DIM_Alarmes'[Status], 0, 'DIM_Alarmes'[Email], 1) 

  

EVALUATE 

  __DS0PrimaryWindowed 

  

ORDER BY 

  [IsGrandTotalRowTotal] DESC, 'DIM_Alarmes'[Status] DESC, 'DIM_Alarmes'[Email]    

" 

    } 

  ], 

  "serializerSettings": { 

    "includeNulls": true 

  } 

  

} 

5 

6 

 

 

 

 

 

 

 

 

 

 

Power BI APP - Delete or Unpublish

 UNPUBLISH DELETE