cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SrinathLM10
Frequent Visitor

Number of cumulative subjects passed by the selected students.

Hi,

 

I have the following data where I have students and the courses they opted for and the status '1' represents pass and '0' represents fail. I want to show a cumulative course status view, where if I select student s1 I should show 3 courses passed and select s1 and s2 should show 4 courses passed (A, B, C, D)

 

SrinathLM10_2-1653192241434.png

1) if I select s1 the cumulative pass should show 3 (since s1 passed in A, B, and D)

SrinathLM10_5-1653192864337.png

2) if I select s1 and s2 the cumulative pass should show 4 (since s1 passed in A, B, D & s2 in B, C).

SrinathLM10_3-1653192590276.png

3) if I select s1, s2 & s3 the cumulative pass should still show 4 (since s1 passed in A, B, D & s2 in B, C & s3 in A, C, D)

SrinathLM10_4-1653192662583.png

4) if I select s1 and s4 the cumulative pass should show 5 (since s1 passed in A, B, D and s4 passed in A, C,E)

SrinathLM10_6-1653192924070.png

Thanks.

1 ACCEPTED SOLUTION

Hi,

Thank you for your feedback.

Could you please check the below picture and the attached file?

I amended one of the measure like below.

 

Untitled.png

 

Result of the course measure: = 
SUMX (
    VALUES ( Course[Course] ),
    CALCULATE (
        COUNTROWS (
            FILTER (
                ADDCOLUMNS (
                    SUMMARIZE ( Data, Data[Status] ),
                    "@status", CALCULATE ( MAX ( Data[Status] ) )
                ),
                [@status] = 1
            )
        )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

7 REPLIES 7
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Untitled.png

 

Total pass measure: = 
SUM( Data[Status] )

 

Result of the course measure: = 
COUNTROWS (
    FILTER (
        ADDCOLUMNS (
            SUMMARIZE ( Data, Data[Status] ),
            "@status", CALCULATE ( MAX ( Data[Status] ) )
        ),
        [@status] = 1
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thanks, @Jihwan_Kim for the reply, I am looking for the measured total (i,e Total pass measure). if all the students are selected the total should show 5 since there are 5 distinct courses and everyone passed at least once, and if we select s1 and s2 Total pass measure should show 4, since s1 passed in A, B, D & s2 in B, C 

Hi,

Thank you for your feedback.

Could you please check the below picture and the attached file?

I amended one of the measure like below.

 

Untitled.png

 

Result of the course measure: = 
SUMX (
    VALUES ( Course[Course] ),
    CALCULATE (
        COUNTROWS (
            FILTER (
                ADDCOLUMNS (
                    SUMMARIZE ( Data, Data[Status] ),
                    "@status", CALCULATE ( MAX ( Data[Status] ) )
                ),
                [@status] = 1
            )
        )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thanks, @Jihwan_Kim for providing the solution.

Hi @Jihwan_Kim Quick follow-up question on the above, how can I have a view(table) which shows the courses not taken by the students

  1.  if all students are selected the table is empty
  2. If I select s1 the table should show E since that's the only course not taken by s1
  3. if I select s2 and s3 the table should show E since that's the only course not taken by both s2 and s3 collectively. 

Thanks in advance.
    

Hi,

Please check the below picture and the attached pbix file.

 

Untitled.png

 

Not taken courses measure: =
VAR _coursestaken =
    VALUES ( Data[Course] )
VAR _condition =
    IF ( VALUES ( Course[Course] ) IN _coursestaken, BLANK (), "Not Taken" )
RETURN
    _condition

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thanks for the Quick solution @Jihwan_Kim, this helps a lot

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors