Forum Discussion
koyDominic
3 years agoRegular Visitor
DAX for Submission KPI
Hi Everyone, I need help fo a DAX for invoice submission KPI. I will create a new column to know if I achieved my KPI for invoice submission. My baseline is the delivery timeout column, my KPIs ...
koyDominic
3 years agoRegular Visitor
Hi Wilson,
Thanks for the reply. I have tried the Weekday function yesterday but I cannot get the result.
I will try the switch function.
Thanks
Wilson_
3 years agoMemorable Member
Hello Errol,
I was hoping you would be more specific on where you were actually getting stuck, for learning's sake. 🙂
In any case, this was my DAX for your calculated column:
Submission KPI =
VAR DayOfTheWeek = WEEKDAY ( Table1[Delivery Time Out], 2 )
VAR InvoiceDeadline =
SWITCH (
TRUE(),
DayOfTheWeek <= 3, Table1[Delivery Time Out] - DayOfTheWeek + 5, -- Time Out - DayoftheWeek will always return the prior Sunday; +5 gets to Friday
Table1[Delivery Time Out] - DayOfTheWeek + 9 -- Time Out - DayoftheWeek will always return the prior Sunday; +9 gets to the following Tuesday
)
RETURN
Table1[Invoice Submitted] <= InvoiceDeadline
Created my own mini dataset for testing and this is what I get in my table:
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)