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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Timbuktu7
Helper I
Helper I

Dax help

Hello World,
cal.PNGcalcuu.PNG
I have two pics here. One in excel (blue color) and anothetr in Power Bi.  I have created a matrix in Power Bi with age category and transactions. 

Now I want to calculate the sucess rate . The formula that I used in Excel is : Sum(Total Transactions/Total Past Dues 1-30 Days)*100%) . Same with the remaining 3 . How do i do same in power bi?
Please help

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

Hi @Timbuktu7 ,

 

I think you can try code as below to create a measure.

Payment success Rate =
VAR _Total =
    SUMX ( ALLSELECTED ( 'Table' ), 'Table'[Transactions] )
VAR _Transactions =
    CALCULATE ( SUM ( 'Table'[Transactions] ) )
RETURN
    DIVIDE ( _Transactions, _Total )

My Sample:

RicoZhou_0-1670317001080.png

Result is as below.

RicoZhou_1-1670317014931.png


Best Regards,
Rico Zhou

 

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-rzhou-msft
Community Support
Community Support

Hi @Timbuktu7 ,

 

I think you can try code as below to create a measure.

Payment success Rate =
VAR _Total =
    SUMX ( ALLSELECTED ( 'Table' ), 'Table'[Transactions] )
VAR _Transactions =
    CALCULATE ( SUM ( 'Table'[Transactions] ) )
RETURN
    DIVIDE ( _Transactions, _Total )

My Sample:

RicoZhou_0-1670317001080.png

Result is as below.

RicoZhou_1-1670317014931.png


Best Regards,
Rico Zhou

 

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

 

A_Ben_Chaoued
New Member

var Total_transaction = sum(Transaction) return

rate = ( Transaction / Total_transaction ) * 100

return rate

 

I hope that help you, good luck 🙂 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors