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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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