Reply
skoza12
Frequent Visitor
Partially syndicated - Outbound

DAX for dividing 2 calculated fields from 2 different tables

Hi - I am new to Power BI and I am trying to duplicate a report from another application that we use which shows the percent of service calls by catagory in relation to total service calls.  In this example I have 195 total service calls and 7 of them are no problem found.  I would like to present this as a percentage.  Thanks for any help!!!!

skoza12_0-1658333902999.png

 

1 ACCEPTED SOLUTION
7 REPLIES 7
technolog
Super User
Super User

Syndicated - Outbound

Hi! 

You can create first measure:

All calls = COUNTROWS('Table calls')

and second measure:

Non fault calls = CALCULATE( [All calls] , 'Table calls'[Action code] = "Tested and returned ....**USE YOU TITLE* " )

and result measure:

Percent of fault = DIVIDE ( [Non fault calls] , [All calls] )

Syndicated - Outbound

HI,

Thank you for a quick response and after a couple of attempts I understand the logic but I am still not outputing the correct data for the first measure. (may be a filtering issue).  I show 204 service calls in the table but when I create the first measure the output is 1480.  

skoza12_0-1658408487609.png

 

Syndicated - Outbound

You can try 

All calls = COUNT('Table calls'[WONumber])

or

All calls = DISTINCTCOUNT('Table calls'[WONumber])

Syndicated - Outbound

Let me give this a try - Thanks

Syndicated - Outbound

I have tried your suggestion and i am almost there.  

My first measure 

skoza12_0-1658754663943.png

Measure 2 

skoza12_1-1658759051486.png

Measure 3

skoza12_2-1658759096395.png

Measrure 1 result = 237

Measure 2 result = 11

Measure 3 result should be 11/237 = 4.64% but is being calcuated as 5.85%

skoza12_3-1658759223999.png

 

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)