Thursday, February 6, 2020

Power BI - Creating Tax measure between two tables



Table_Moviments:

Table_Tax
____________________________________________________________________

.00YYYYMMDD = MAX(Table_Moviments[a_YYYYMMDD])
____________________________________________________________________

.01GetTax = 
Var v_Val01 = "Variavel01"
return
CALCULATE(SUM(Table_Tax[ValorHora]),
          FILTER(Table_Tax,
          Table_Tax[Referencia] = v_Val01 && 
          Table_Tax[DataInicial] <= [.00YYYYMMDD]&& 
          Table_Tax[DataFinal] >= [.00YYYYMMDD]
          )
        )

____________________________________________________________________

.02GetTaxGroup = SUMX(
                SUMMARIZE(
                    Table_Moviments,
                    Table_Moviments[a_TicketPrio],
                    Table_Moviments[a_TicketDate]),
                    [.01GetTax]
)
____________________________________________________________________

.03QtdHoursRealGroup = SUMX(
                SUMMARIZE(
                    FATTickets_WorkLogs, 
                    FATTickets_WorkLogs[a_TicketPrio],
                    FATTickets_WorkLogs[a_TicketDate]),
                    [HoursMov])
____________________________________________________________________

.04VlrCostRealGroup = SUMX(
                SUMMARIZE(
                    Table_Moviments,
                    Table_Moviments[a_TicketPrio],
                    Table_Moviments[a_TicketDate]),
                    ([.03QtdHoursRealGroup]*[.02GetTaxGroup])
)
___________________________________________________________________

No comments:

Post a Comment

Power BI APP - Delete or Unpublish

 UNPUBLISH DELETE