Forum Discussion

GS_Developer's avatar
GS_Developer
New Member
4 years ago

Order to quote conversion data DAX filter query

I have 2 tables coming from Business Central into Power BI Desktop - Sales Orders and Sales Quotes. Now, we want to get the quote to order conversion data for a specific time duration as per the user for this data. So currently these 2 tables are connected by their creation dates. I need help creating a DAX query that would count the number of sales quotes created within a specific time period - for example last 1 month and divide it up with the number of orders created within the same period. That way I would be able to get the conversion percentage. 

salesOrders have the column orderDate and salesQuotes have documentDate.

Any help with the filter query would be appreciated. Thanks!

2 Replies

  • GS_Developer you should add a calendar dimension in your model, you can follow my blog post here Create a basic Date table in your data model for Time Intelligence calculations | PeryTUS IT Solutions to create one.

     

    Have relationship with date dimension to your sales order and quote table, and in visualization use year/month/date from date dimension and count from other two tables and you will get the result

     

     

    Follow us on LinkedIn and  to our YouTube channel

     

    Learn about conditional formatting at Microsoft Reactor

    My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi GS_Developer 

    Based on the data structure and desired outcome you shared, I create an example for your reference,

    Sample

    in the sample, total for Sales Orders=81, total for Sales Quotes=52. so the result= 81/52.

    create a measure:

    Measure = 
        var _selectYear= VALUE(SELECTEDVALUE(Slicer[Year]))
        var _selectMonth= VALUE(SELECTEDVALUE(Slicer[Month]))
        var _SalesOrders= CALCULATE(SUM('Sales Orders'[value]),FILTER(ALL('Sales Orders'),MONTH('Sales Orders'[creation dates])=_selectMonth && YEAR('Sales Orders'[creation dates])= _selectYear))
        var _salesQuotes= CALCULATE(SUM('Sales Quotes'[value]),FILTER(ALL('Sales Quotes'),MONTH('Sales Quotes'[creation dates])=_selectMonth && YEAR('Sales Quotes'[creation dates])= _selectYear))
    return 
        DIVIDE(_SalesOrders,_salesQuotes)

    result

     

    Best Regards,

    Community Support Team _Tang

    If this post helps, please consider Accept it as the solution to help the other members find it more quickly.