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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
EbyEaso
Helper III
Helper III

Ratio Calculation

Hello, I need some assistance here. I have below sample data. I need to find out the ratio between two status of the issue.

 

Needed output is ration between the types of issue (but only between Parts and Hardware). In this case it is 1:2

 

Somebody can please assist me? So that I can get ration for each site.

 

Sl NoLocationType Of IssueDate ReportedStatus
1Site 1Hardware10-Jan-24Resolved
2Site 2Software10-Jan-24In Progress
3Site 3Software10-Jan-24Resolved
4Site 2Parts15-Jan-24Awaiting
5Site 2Hardware15-Jan-24Resolved
6Site 3Parts31-Jan-24Resolved
7Site 7Hardware2-Feb-24Resolved
8Site 8Hardware2-Feb-24Awaiting
9Site 7Software20-Feb-24In Progress
10Site 10Software20-Feb-24Resolved
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @EbyEaso ,

Based on your problems, here are my answers.

First I created a table based on your description.

vyilongmsft_0-1708664248948.png

Then created four Measure.

Total Hardware Issues = SUMX(FILTER('Table', 'Table'[Type Of Issue] = "Hardware"), 1)
Total Parts Issues = SUMX(FILTER('Table', 'Table'[Type Of Issue] = "Parts"), 1)
Issue Ratio = DIVIDE([Total Hardware Issues], [Total Parts Issues])
Ratio Display = (CONCATENATE("1:", [Issue Ratio]))

Finally you will see the result you want.

vyilongmsft_0-1708665493646.png

 

 

Best Regards

Yilong 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

6 REPLIES 6
EbyEaso
Helper III
Helper III

Thank You @ThxAlot  and @Jihwan_Kim 

Bu am looking in a ration form. Example as below.

 

 

Thank You @ThxAlot  @Jihwan_Kim 

But am looking in a ration form.

 

Example as below.

 

SiteHardwarePartsRatio
Site 11 1:0
Site 2211:1
Site 35151:3
Anonymous
Not applicable

Hi @EbyEaso ,

Based on your problems, here are my answers.

First I created a table based on your description.

vyilongmsft_0-1708664248948.png

Then created four Measure.

Total Hardware Issues = SUMX(FILTER('Table', 'Table'[Type Of Issue] = "Hardware"), 1)
Total Parts Issues = SUMX(FILTER('Table', 'Table'[Type Of Issue] = "Parts"), 1)
Issue Ratio = DIVIDE([Total Hardware Issues], [Total Parts Issues])
Ratio Display = (CONCATENATE("1:", [Issue Ratio]))

Finally you will see the result you want.

vyilongmsft_0-1708665493646.png

 

 

Best Regards

Yilong Zhou

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

@Anonymous  Thank you for the response and udpate. Apreciate it. It works. Cool.

 

I havew one more thing. What if we have more decimal values in the outout. I tried to chnage the decimal value to zero, but it wont change in the result.

 

EbyEaso_0-1709117296894.png

 

@Anonymous 

 

Is it possible to remove the decimal points?

 

EbyEaso_0-1709715481795.png

 

ThxAlot
Super User
Super User

ThxAlot_0-1708593541545.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Jihwan_Kim
Super User
Super User

Hi,

I am not sure about how your semantic mode looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1708576733813.png

 

Jihwan_Kim_1-1708577334361.png

 

KEEPFILTERS function (DAX) - DAX | Microsoft Learn

 

Issue count % only hardware + parts: =
VAR _countall =
    COUNTROWS (
        CALCULATETABLE (
            Data,
            'Type Of Issue'[Type Of Issue] IN { "Hardware", "Parts" }
        )
    )
VAR _count =
    COUNTROWS (
        CALCULATETABLE (
            Data,
            KEEPFILTERS ( 'Type Of Issue'[Type Of Issue] IN { "Hardware", "Parts" } )
        )
    )
RETURN
    DIVIDE ( _count, _countall )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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