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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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

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.

@v-yilong-msft  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

 

@v-yilong-msft 

 

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.LeanAndPractise(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.


Go to My LinkedIn Page


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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