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.
Hi team,
I have a fact table which contains Student's details like below (attached sample copy),
I'm trying to create a DAX expression that will enable me to return data when a student failed/passed status is in between a selected date range.
For example consider HARRY Data from below table When i select a date range of 01/01/19 to 31/05/21 using a date slicer, He should be treated as failed student and his count should be in Failed count, If i move slicer to 06/01/21 His count should be removed from Failed count and should be added in Passed student as he passed the exam on 06/01/21.
Please let me know if needed more information.
Hi @Haripoola ,
Does that make sense? If so, kindly mark my answer as the solution to close the case and help more people find the answer please. Thanks in advance. Or if you have resolved the issue, please share your way.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Haripoola ,
Please refer to my pbix file to see if it helps you.
Create a measure.
Measure= calculate(DISTINCTCOUNT('Table'[StudentID]),FILTER(('Table'),'Table'[ExamStatus]=SELECTEDVALUE('Table'[ExamStatus])))
If I have misunderstood your meaning, please provide your pbix file without privacy information and desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Haripoola , Refer
meausre =
var _max = maxx(filter(allselected(Table), Table[StudentID] = max(Table[StudentID])), Table[StudentUpdatedon])
return
calculate(count(Table[StudentID]), filter(Table, Table[StudentUpdatedon] =_max))
or
Measure =
VAR __id = MAX ('Table'[StudentID] )
VAR __date = CALCULATE ( MAX('Table'[StudentUpdatedon] ), ALLSELECTED ('Table' ), 'Table'[StudentID] = __id )
CALCULATE (count(Table[StudentID]), VALUES ('Table'[StudentID] ),'Table'[StudentID] = __id,'Table'[StudentUpdatedon] = __date )
Thank you for your solution and I think it works for my requirement.
Could you please suggest me how to calculate with combination of StudentID and StudentName.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
27 | |
20 | |
15 | |
12 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
18 |