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 August 31st. Request your voucher.

Reply
AC422
Regular Visitor

Calculating the rate at each time point

I am new to Power BI.

 

I have 2 datasets that I need to calculate the deviation rate for each site number based on the total number of deviations and the total number of people treated at the same time point.

 

For example, in 2024 Q2, site number 105 had a total of 3 deviations; only 1 person was treated. The rate should then be 3. By 2025 Q1, site number 105 had a total of 4 deviations but 3 persons were treated. The rate should then go down to 1.33.

Do I need to link the tables? How do I show all the rates in each quarter for each site number from PRPOV?

 

PRPOV table:

Site.NumberSubject.NamePRSTDAT
10210200102/20/2025
10210200503/20/2025
10210200704/10/2025
10510500504/11/2024
10510500611/21/2024
10510500701/29/2025
10510500804/03/2025
10510500904/03/2025
10510501004/10/2025
10510501104/10/2025
10510501204/17/2025
10510501304/17/2025
10610600101/10/2024
10610600201/03/2024
10610600312/13/2023
10610600401/31/2024
10610600601/22/2025
10610600701/22/2025
10610600804/09/2025
10610600903/18/2025
10710700111/09/2023
10710700312/01/2023

 

Deviation Table:

Site.NumberSubject.NameDVSTDAT
10210200303/21/2025
10510500204/08/2024
10510500304/08/2024
10510500505/31/2024
10510500503/03/2025
10610600302/02/2024
10710700111/29/2023
11211200203/30/2025
11211200401/28/2025
12112100602/12/2025
1 ACCEPTED SOLUTION

@AC422 I created a YQ table and a Sites table and this measure. See PBIX attached below sig:

Measure = 
    DIVIDE( 
        COUNTROWS( DISTINCT('Deviation'[Subject.Name]) ),
        COUNTROWS( DISTINCT( 'PRPOV'[Subject.Name] ) )
    )

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
AC422
Regular Visitor

Hi @Greg_Deckler, the deviation table has 3 under site number 105 in 2024 Q2 but the PRPOV table has only 1 under site number 105 in 2024 Q2. The rate should then be 3/1 = 3.

 

Here's what I want to see as the end result (showing only site numbers 102, 105 and 106 for now):

QuarterSite NumberDeviation Rate
2024 Q21020.00
2024 Q21053.00
2024 Q21060.25
2024 Q31020.00
2024 Q31053.00
2024 Q31060.25
2024 Q41020.00
2024 Q41051.50
2024 Q41060.25
2025 Q11020.50
2025 Q11051.33
2025 Q11060.14
2025 Q21020.33
2025 Q21050.44
2025 Q21060.13

 

@AC422 I created a YQ table and a Sites table and this measure. See PBIX attached below sig:

Measure = 
    DIVIDE( 
        COUNTROWS( DISTINCT('Deviation'[Subject.Name]) ),
        COUNTROWS( DISTINCT( 'PRPOV'[Subject.Name] ) )
    )

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@AC422 I don't understand the calculation here. From what I see in Deviation table, in Q2 2024 there are three different subject names, 105002, 105003, 105005. So that would seem like 3 and 3 which would be 1. 

 

Also, can you share what you are trying to achieve (the end result).



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.

Top Solution Authors