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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
spandy34
Responsive Resident
Responsive Resident

Calculating Records Between a Range of Percentages

Hello

 

I have created the following measure to calculate the number of distinct [ssref] where the [Delivered Duration Deminal] is 25% greater than the [Planned Duration Decimal]

 

25% More Proc Main = CALCULATE(
DISTINCTCOUNT('Procurement_Main_Data'[ssref]),
'Procurement_Main_Data', 'Procurement_Main_Data'[Delivered Duration Decimal] > 'Procurement_Main_Data'[Planned Duration Decimal] * 1.25 )

 

How can I alter the measure to calculate the number of distinct [ssref] where the [Delivered Duration Deminal] is between 0% and 25% greater than the [Planned Duration Decimal]

 

Thank you 

 

@danextian @v-heq-msft @Greg_Deckler 

1 ACCEPTED SOLUTION

Hi @Greg_Deckler 

 

I have looked at the data and already have a column called Variance % which is a Percentge format field and calculates the % difference between Planned Time and Delivered Time.

I have tried to have a go at creating a measure that calculates the number of rows where the % Variance is Between 0% and 25%.  The measure below has now worked so I can get the number of records with a variance between 0 and 25%

 

% Variance Btween 0 and 25 =
COUNTROWS (
FILTER (
'Procurement_Main_Data',
'Procurement_Main_Data'[Variance %] >= 0
&& 'Procurement_Main_Data'[Variance %] <= 1.25
)

 

 

spandy34_0-1714178748982.png

 

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@spandy34 Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler 

 

I have looked at the data and already have a column called Variance % which is a Percentge format field and calculates the % difference between Planned Time and Delivered Time.

I have tried to have a go at creating a measure that calculates the number of rows where the % Variance is Between 0% and 25%.  The measure below has now worked so I can get the number of records with a variance between 0 and 25%

 

% Variance Btween 0 and 25 =
COUNTROWS (
FILTER (
'Procurement_Main_Data',
'Procurement_Main_Data'[Variance %] >= 0
&& 'Procurement_Main_Data'[Variance %] <= 1.25
)

 

 

spandy34_0-1714178748982.png

 

spandy34_0-1714159142001.png

 

Currently I have a measure that counts the number of SSRef where the Delivered Duration Hours is 20% greater than Planned Duration Hours but I now what to count the SSRef where Delivered Duration Hours is between 0% and 20%  greater as opposed to just 20% than Planned Duration Hours

 

z_25% More Proc Main = CALCULATE(

COUNT('Procurement_Main_Data'[ssref]),

 'Procurement_Main_Data', 'Procurement_Main_Data'[Delivered Duration Hours] > 'Procurement_Main_Data'[Planned Duration Hours] * 1.25 )+0

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors