Forum Discussion

olivierschelstr's avatar
olivierschelstr
Regular Visitor
5 years ago
Solved

Create calculation table in PowerBI

Hi,    Instead of having to calculate the table (see print screen) on the right side, I would like to have it in a table form in the PowerBI desktop itself.    I will load the table untill column...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hello @olivierschelstr ,

    Here are the steps you can follow:

    1. Create the calculated column and measure, find out. If the order is shipped on time, if the order is delayed, days late

    Column:

    Req_VS_Conf_Column = IF('Table'[Req.Supplier Delivery Date]>='Table'[Product Ready Confirmation Date],"OK","Nok")
    
    Req_VS_Load_Column = IF('Table'[Req.Supplier Delivery Date]>='Table'[Loadingdate],"OK","NOK")

    Measure:

    days_late_Req_Ready = DATEDIFF(MIN('Table'[Req.Supplier Delivery Date]),MAX('Table'[Ready as from/at Ardo site]),DAY)
    
    days_late_Req_Loading = DATEDIFF(MIN('Table'[Req.Supplier Delivery Date]),MAX('Table'[Loadingdate]),DAY)

    Result:

    v-yangliu-msft_0-1605000992539.png

    2. Create a measure, find total orders, OK orders, NOK orders, service level, average days late.

    Total Orders = COUNT('Table'[Req_VS_Conf_Column])
    
    Req_Conf_Service_Level = DIVIDE(CALCULATE(COUNT('Table'[Req_VS_Conf_Column]),FILTER('Table','Table'[Req_VS_Conf_Column]="OK")),COUNTX(ALL('Table'),[Req_VS_Conf_Column]))
    
    Req_conf_Average_days_late = SUMX(ALL('Table'),'Table'[days_late_Req_Ready])/COUNTX(ALL('Table'),'Table'[days_late_Req_Ready])
    
    Req_Load_Service_Level = DIVIDE(CALCULATE(COUNT('Table'[Req_VS_Load_Column]),FILTER('Table','Table'[Req_VS_Load_Column]="OK")),COUNTX(ALL('Table'),[Req_VS_Load_Column]))
    
    Req_Load_Average_days_late = SUMX(ALL('Table'),'Table'[days_late_Req_Loading])/COUNTX(ALL('Table'),'Table'[days_late_Req_Loading])

    Result:

    v-yangliu-msft_1-1605000992546.png

    You can download the PBIX file from here.

    Best regards

    Liu Yang

    If this post helps,then consider Accepting it as the solution to help other members find it faster.