The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I need to write a measure that counts the unique applicant IDs in my snapshots table whose stage ID is a certain value and I need this measure to be accurate year by year as I will be putting it in a table with years on the rows. I already have measure that count new applicants, cumulative applicants, and cumulative applicants who make it to the stage, but I cannot get the measure for new applicants who make it to the stage to work. Common problems that I am having are that the measure will count all of the unique applicant IDs whose stage ID matches for the year, but not filter out those who entered the stage in the prior year. Below are some of my measures and the table that I am trying to create without the new applicants who made it to stage X measure:
Hi @KyleFerrero ,
You can try this measure, which agrees with this calculated column output.
Measure =
VAR EntryDate =
CALCULATE(
MIN(SnapshotApplicants[SnapshotDate]),FILTER(ALLSELECTED('SnapshotApplicants'),
SnapshotApplicants[stage.id] IN {"1487532452977"}))
RETURN
IF(NOT(ISBLANK(EntryDate)), EntryDate, BLANK())
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Update: I was able to get the desired results through the use of a calculated column, but I am wondering about a measure only based approach for learning purposes if nothing else. How would I get these results without the use of a calculated column.
Calculated column on Applicants table:
Stage X Entry Date = VAR EntryDate = CALCULATE( MIN(SnapshotApplicants[SnapshotDate]), SnapshotApplicants[stage.id] IN {"1487532452977"}) RETURN IF(NOT(ISBLANK(EntryDate)), EntryDate, BLANK())
Measure:
New Applicants who made it to Stage X= VAR NewInterviewCount = CALCULATE( DISTINCTCOUNT(Applicants[ApplicantID]), YEAR(Applicants[Testing Entry Date]) = SELECTEDVALUE('Calendar'[Year]) ) RETURN IF(NOT(ISBLANK(SELECTEDVALUE('Calendar'[Year]))), NewInterviewCount, BLANK())
Hi @KyleFerrero ,
Sorry for that the information you have provided is not making the problem clear to me.
Please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Refer to:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
Best Regards,
Neeko Tang
@v-tangjie-msft I will try to explain the model/problem the best I can. I have a dataset that is tracking the application pipeline for my company. In this dataset, I am primarily focusing on the snapshots table which contains Applicant IDs, Stage IDs, and Snapshot dates. These have many to one relationship with the calendar, applicants, and stages tables, and a new snapshot of the pipeline is taken each day. I am trying to create a matrix visual that shows years from the calendar table on the rows, and a few measures as the values. I would like these measures to be cumulative applicants, cumulative applicants who made it to Stage X, new applicants, and new applicants who made it to stage X. All of the measures are working properly outside of the new applicants who made it to Stage X measure.
Hi @KyleFerrero, give this a try, and if you encounter any issues, let me know.
New Applicants who made it to Stage X =
CALCULATE(
DISTINCTCOUNT(SnapshotApplicants[ApplicantsID]),
FILTER(
SnapshotApplicants,
SnapshotApplicants[stage.id] = "1487532452977" && -- Condition for stage X
YEAR(SnapshotApplicants[SnapshotDate]) = SELECTEDVALUE('Calendar'[Year])
),
FILTER(
SnapshotApplicants,
YEAR(SnapshotApplicants[Min Snapshot Date]) < SELECTEDVALUE('Calendar'[Year])
)
)
Did I answer your question? If so, please mark my post as the solution! ✔️
Your Kudos are much appreciated! Proud to be a Solution Specialist!
@ahadkarimi
Did not work, this is what my Min Snapshot Date measure looks like as I forgot to include it and you used it in your solution:
This is my current measure:
New Applicants who made it to Stage X=
CALCULATE(
DISTINCTCOUNT(SnapshotApplicants[ApplicantsID]),
FILTER(
SnapshotApplicants,
SnapshotApplicants[stage.id] = "1487532452977" &&
YEAR([Min Snapshot Date]) = SELECTEDVALUE('Calendar'[Year])
)
)
and here is what the table looks like:
As you can see the numbers are slightly off and I believe this is because my measure is not counting those who entered the pipeline in a prior year but entered stage X in the selected year.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
21 | |
19 | |
18 | |
18 | |
14 |
User | Count |
---|---|
36 | |
34 | |
20 | |
19 | |
15 |