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
RLaan
New Member

Measure help - Count of RANKX per date with dynamic filtering

Hello all,

 

I'm having trouble with the following. I have a dataset which contains tons of e-mail IDs. The IDs can flow in a mailbox for the first time or can also flow in a mailbox from another mailbox. I want to count the IDs on the date when they first came into a mailbox but with dynamic filtering. Below here is a sample dataset of two e-mails.
Test.PNG

The data set above here has the following variables:
Date: each e-mail will be in the dataset until it is being handled. This dataset contains data until the 16th of February
ID: E-mail ID. Currently there are two IDs in this sample set
Step: when an e-mail comes in the dataset for the first time, it will get the number one and every step it takes will be in the dataset then untill it is handled.
In: Mail comes in the mailbox. When the Step = 1, then it will be the first time in the dataset. When Step > 1, then the mail was already in the dataset.
Out: Mail goes out of the mailbox.

I'm looking for a line graph using a measure which looks dyanmically at the first time an e-mail comes in the dataset and then counts that across dates. The line graph then will solely be this measure and the date variable. Currently in the above dataset, there are no filters being used on MailBox, so using no filters, I expect a value of 1 on the 3rd of february. However, when I filter on Mailbox = "Zakelijk", I expect a value of 1 on the 4th of February.

 

So basically, I'm looking for something like a ranking per ID which takes the complete dataset, and when the ranking is 1, then I want to count that for all the e-mails. However, filtering changes the ranking dynamically.

I've looked at something like this, but it's not really working:


First time in = IF (
HASONEVALUE ( 'E-mail'[ID] );
IF (
RANKX (
FILTER (
ALL('E-mail');
'E-mail'[ID] = MIN ( 'E-mail'[ID] )
);
CALCULATE(MIN('E-mail'[Step]);
FILTER(ALL('E-mail'); 'E-mail'[In] <> BLANK () && 'E-mail'[ID] = MIN('E-mail'[ID]))
;
;
1;
DENSE
)
= 1;
1;
0
);
DISTINCTCOUNTNOBLANK('E-mail'[ID])
)
))


Can anybody please help me with this? I've been struggling with it for a week already.

Thanks so much in advance! And if I need to add any information, feel free to ask.

2 REPLIES 2

Unfortunately, that was not was I was looking for. I tried the following, but it doesn't help; it only takes the 'Step 1' into account, whereas some e-mails get in a mailbox at step 3.

First time in =
VAR Eerstekeer_inbox = CALCULATE(MIN('E-mail'[Step]);   
ALLEXCEPT('E-mail'; 'E-mail'[E-mail-ID]); 'E-mail'[In] <> BLANK())

RETURN SUMX('E-mail';    IF('E-mail'[Step] = Eerstekeer_inbox;1;blank()))

 

 

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.