Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.