Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

Dax for finding conversion rate

Hello altruist,

 

I need to find the inquiry to the application conversion rate for the current week in comparison to the inquiry in the same week last month. Here's a snapshot of the source table and the target table. Does anyone have any idea how to find the conversion rate?

 

jubaer101_2-1650388651565.png

 

 

 

 

Thanks

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. 

1. Create the two calculated columns as below to get the special week number

StartdayofWeek = 'Table'[Date]
                    + -1
                        * IF (
                            WEEKDAY ( 'Table'[Date] ) < 6,
                            WEEKDAY ( 'Table'[Date] ) + 1,
                            WEEKDAY ( 'Table'[Date] ) - 6
                        )
Week = 
1 + WEEKNUM ( 'Table'[StartdayofWeek], 1 )
    - WEEKNUM ( STARTOFMONTH ( 'Table'[StartdayofWeek] ), 1 )

 yingyinr_0-1650618773222.png

2. Create a measure as below to get the conversion rate

Conversion rate = 
VAR _appcount =
    SUM ( 'Table'[Application Count] )
VAR _premonthinqcount =
    CALCULATE (
        SUM ( 'Table'[Inquiry Count] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            YEAR ( 'Table'[Date] ) = SELECTEDVALUE ( 'Table'[Date].[Year] )
                && MONTH ( 'Table'[Date] )
                    = SELECTEDVALUE ( 'Table'[Date].[MonthNo] ) - 1
                && 'Table'[Week] = SELECTEDVALUE ( 'Table'[Week] )
        )
    )
RETURN
    DIVIDE ( _appcount, _premonthinqcount, 0 )

yingyinr_1-1650618856909.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. 

1. Create the two calculated columns as below to get the special week number

StartdayofWeek = 'Table'[Date]
                    + -1
                        * IF (
                            WEEKDAY ( 'Table'[Date] ) < 6,
                            WEEKDAY ( 'Table'[Date] ) + 1,
                            WEEKDAY ( 'Table'[Date] ) - 6
                        )
Week = 
1 + WEEKNUM ( 'Table'[StartdayofWeek], 1 )
    - WEEKNUM ( STARTOFMONTH ( 'Table'[StartdayofWeek] ), 1 )

 yingyinr_0-1650618773222.png

2. Create a measure as below to get the conversion rate

Conversion rate = 
VAR _appcount =
    SUM ( 'Table'[Application Count] )
VAR _premonthinqcount =
    CALCULATE (
        SUM ( 'Table'[Inquiry Count] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            YEAR ( 'Table'[Date] ) = SELECTEDVALUE ( 'Table'[Date].[Year] )
                && MONTH ( 'Table'[Date] )
                    = SELECTEDVALUE ( 'Table'[Date].[MonthNo] ) - 1
                && 'Table'[Week] = SELECTEDVALUE ( 'Table'[Week] )
        )
    )
RETURN
    DIVIDE ( _appcount, _premonthinqcount, 0 )

yingyinr_1-1650618856909.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Anonymous ,  Creat a date table with the week

Create a Friday week from here

Any Weekday Week - Start From Any day of Week
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Power-BI-Turning/ba-p/1187482

 

Then

you need measures

Inquiry = Sum(Table[Count of Inquiry]

 

Applications= Sum(Table[Application Count]

 

Conversion = divide([Inquiry ],[Applications])

 

refer if needed

 

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.