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
zeke101
Helper II
Helper II

Percentage Calculation from 2 tables

Hey Guys,

I'm requesting some help on building this measure....

I have 2 tables (an Events table and Rejects Table).

 

The Events table contains the total number of events that occurred for a certain location, time period, client, etc. 

Events Table Example:

zeke101_0-1633992751396.png

 

The Rejects table contains the count Rejects of the Events in the table above along with additional information such as what queue it was rejected the reject reason, etc. 

Rejects Table Example:

zeke101_1-1633993207582.png

 

All I'm trying to accomplish is getting the Rejects as a % of total Event volume. 

 

I thought it would be as simple as dividing Rejects Count / Event Count.

Here's what I created....

Rejects as a % of Event Volume = CALCULATE(sum(Rejects_All2[COUNT(*)])/CALCULATE(sum('Events All'[COUNT(*)])))

 

But the calc is giving me an "infinity" %

zeke101_2-1633993828574.png

 

Any idea on what I'm doing wrong with the calc?

1 ACCEPTED SOLUTION
zeke101
Helper II
Helper II

I did a little bit of research and found a measure that works.....

 

Rejects as a % of Event Volume =
DIVIDE(
'Key Measures'[Total Reject Vol],
CALCULATE(Sum('Events All'[COUNT(*)]),FILTER('Events All','Events All'[Client ID & Site ID]=SELECTEDVALUE(Rejects_All2[Client ID & Site ID]))))

View solution in original post

5 REPLIES 5
zeke101
Helper II
Helper II

I did a little bit of research and found a measure that works.....

 

Rejects as a % of Event Volume =
DIVIDE(
'Key Measures'[Total Reject Vol],
CALCULATE(Sum('Events All'[COUNT(*)]),FILTER('Events All','Events All'[Client ID & Site ID]=SELECTEDVALUE(Rejects_All2[Client ID & Site ID]))))
VahidDM
Super User
Super User

Hi @zeke101 

 

If you want to find the % of Rejectes based on the All Events, Try this:

Measure = COUNTROWS(Rejects_All2)/COUNTROWS(Events All)

 

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

Appreciate your Kudos!!

 

Hi @VahidDM 

This wont work as it only counts the rows of the table, but each row value is worth more than 1.  Notice how the tables have a "Count (*)" column. Those numbers need to be aggregated and then a calculation must be derived to create the percentage. 

 

Hi @zeke101 

 

Is there any relationship between those tables? if yes, which columns are connected to each other?

 

Try this measure:

Rejects as a % of Event Volume =
Var _ALL =SUM(Rejects_All2[COUNT(*)])
Var _REJ = SUM('Events All'[COUNT(*)])
return
_REJ/_ALL

 

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

Appreciate your Kudos!!

 

Hi @VahidDM 

Unfortunately, this measure did not work - Calc is still giving me an "infinity" %

 

I dont have a relationship between the 2 tables. Here is what the relationship Model looks like:

zeke101_0-1634082377573.png

 

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.

Top Solution Authors