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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
bgepps
Frequent Visitor

Counting changes between different status'

I have a database which gives me information on jobs going through a system, and the different status' of these jobs.

 

Two of these status' are; 'Awaiting Approval', and 'Amends'.

 

I have the following columns of information available to me; job id, status.

 

What i would like to do is use a formula to count how many times the status changes between 'awaiting approval' and 'amends' for each individual job.

 

Does anybody know a formula/measure that could complete this?

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @bgepps,

 

I have an idea to deal with your requirement, perhaps you can take a look at below steps if it works on your side.

 

Steps:

1. Get the Current "Job ID" from row content.
2. Look up the records which contain current job id, and remove the duplicate records.
3. calculated the rows of above records, if the result is large than  1, it means the job id's status is changed.
4. Loop through the table with above logic and get the count of changed job id.

 

Sample:

IsChanged = 
var temp = LASTNONBLANK(Table[JobID],[JobID])
var CountOfJobID= COUNTROWS(DISTINCT(FILTER(ALL(Table),[JobID]=temp)))
return
if(CountOfJobID>1,TRUE(),FALSE())

CountOfChangedID = CALCULATE(DISTINCT(Table[JobID]),FILTER(ALL(Table),[IsChanged]=TRUE()))

 

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft,

 

Thanks for your insight. I think the easy way to do this is create an average of the 'Amends' status that appears. I can get a count of the amount of times 'Amends' is selected, but can't work out how to calculate an average from that count.

 

Do you know how to do this?

 

Thanks,

 

Ben

Hi @bgepps.

 

>> I think the easy way to do this is create an average of the 'Amends' status that appears. I can get a count of the amount of times 'Amends' is selected, but can't work out how to calculate an average from that count.

 

You can get the count of specific state, then use above count to divide the distinct count of job id.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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