Forum Discussion
Anonymous
5 years agoNot applicable
DAX to count student record from same column
Hi All, Can I get some help for DAX script I created a scenario and it is just a simple count. StudentID Subject MeasureName MeasureValue 1 Chemistry QuestionsAsked 2 1 Chemis...
- 5 years ago
Anonymous
Here is the measure and corrected calculation:Status Measure = SUMX( Table1 , VAR __Q = CALCULATE( SUM(Table1[MeasureValue]), Table1[MeasureName] = "QuestionsAsked", ALLEXCEPT(Table1, Table1[StudentID], Table1[Subject] ) ) VAR __A = CALCULATE( SUM(Table1[MeasureValue]), Table1[MeasureName] = "QuestionsAnswered", ALLEXCEPT(Table1, Table1[StudentID], Table1[Subject] ) ) RETURN IF( [MeasureName] = "QuestionsAsked" , IF( __Q = __A , 1 , BLANK())) )________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
Fowmy
5 years agoSuper User
Anonymous
Go to your table in Data view and add this code as a New Column:
Status =
VAR __A =
CALCULATE(
SUM(Table1[MeasureValue]),
Table1[MeasureName] = "QuestionsAnswered",
ALLEXCEPT(Table1, Table1[StudentID], Table1[Subject] )
)
RETURN
IF(
IF( [MeasureName] = "QuestionsAsked" , [MeasureValue] - __A, 0) = 0, BLANK(), [MeasureValue] - __A
)You show it in the visual as
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂