Forum Discussion

Rakesh_508's avatar
Rakesh_508
Icon for Helper I rankHelper I
2 years ago
Solved

Paginated report - Builder

Hello, Below is my requirement   Create a sample data in excel for class 10th and class has 3 sections (in each class assume students between 4 to 8 and student count should not be same between 2 ...
  • hackcrr's avatar
    2 years ago

    Hi, Rakesh_508 

    Step 1: Create Sample Data in Excel:

    | Class | Section | Student ID | Student Name | Math | Physics | Chemistry |
    |-------|---------|------------|--------------|------|---------|-----------|
    | 10    | A       | 1          | John Doe     | 75   | 65      | 70        |
    | 10    | A       | 2          | Jane Smith   | 45   | 55      | 60        |
    | 10    | A       | 3          | Jim Brown    | 30   | 35      | 25        |
    | 10    | A       | 4          | Jake White   | 85   | 90      | 88        |
    | 10    | B       | 5          | Julia Black  | 55   | 45      | 50        |
    | 10    | B       | 6          | Joe Blue     | 60   | 70      | 65        |
    | 10    | B       | 7          | Jessica Red  | 80   | 85      | 90        |
    | 10    | B       | 8          | Jack Green   | 35   | 40      | 45        |
    | 10    | C       | 9          | Jill Yellow  | 65   | 70      | 75        |
    | 10    | C       | 10         | Jerry Purple | 25   | 30      | 20        |
    | 10    | C       | 11         | Jeff Brown   | 40   | 50      | 55        |
    | 10    | C       | 12         | Jordan White | 95   | 98      | 97        |

    Step 2: Import Data into Power BI

    We need to create a calculated column:

    Total Marks = [Math] + [Physics] + [Chemistry]
    
    Percentage = [Total Marks] / 300 * 100
    
    Division = 
    SWITCH(
        TRUE(),
        [Percentage] > 60, "1st Division",
        [Percentage] > 40, "2nd Division",
        [Percentage] > 30, "3rd Division",
        "Fail"
    )

    Step 3: Develop Report in Power BI Report Builder:

    We need to use the semantic model we just used in the report builder, Use the following query to select the required data:

    SELECT 
        [Class], 
        [Section], 
        [Student ID], 
        [Student Name], 
        [Math], 
        [Physics], 
        [Chemistry], 
        [Total Marks], 
        [Percentage], 
        [Division] 
    FROM [YourDataset]

    In the report builder, you can add calculated fields for total marks, percentage, and division using expressions similar to the ones created in Power BI. Example Expression for Percentage and Division:

    =Fields!Math.Value + Fields!Physics.Value + Fields!Chemistry.Value
    =Switch(
        Fields!Percentage.Value > 60, "1st Division",
        Fields!Percentage.Value > 40, "2nd Division",
        Fields!Percentage.Value > 30, "3rd Division",
        True, "Fail"
    )

    Add a table or matrix to display student details, total marks, percentage, and division.

    Here's an example of how you might structure the report in Power BI Report Builder:

    Page Header:
    - Report Title
    - Date
    
    Body (for each student):
    - Student Name: [Student Name]
    - Class & Section: [Class] - [Section]
    - Subjects and Marks:
      | Subject   | Marks   |
      |-----------|---------|
      | Math      | [Math]  |
      | Physics   | [Physics] |
      | Chemistry | [Chemistry] |
    - Total Marks: [Total Marks]
    - Percentage: [Percentage]%
    - Division: [Division]
    
    Page Footer:
    - Page Number

     

    hackcrr

    If this post helps, then please consider Accept it as the solution and kudos to this post to help the other members find it more quickly

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi,Rakesh_508 .I am glad to help you.
    Hello,hackcrr ,thanks for your concern about this issue.Your answer is excellent!
    And I would like to share some additional solutions below.


    You could follow my test result:

    Enter data:

    Add each subject index column

    Here is my test Code:

     

    =Switch( 
    Fields!Rank_Math.Value >= Count(Fields!Rank_Math.Value, "DataSet_C1003") * 0.6,
    "1st division",
    Fields!Rank_Math.Value<Count(Fields!Rank_Math.Value, "DataSet_C1003") * 0.6 And 
    Fields!Rank_Math.Value>=Count(Fields!Rank_Math.Value, "DataSet_C1003") * 0.4,
    "2nd division",
    Fields!Rank_Math.Value<Count(Fields!Rank_Math.Value, "DataSet_C1003") * 0.4 And 
    Fields!Rank_Math.Value>=Count(Fields!Rank_Math.Value, "DataSet_C1003") * 0.3,
    "3rd division",
    Fields!Rank_Math.Value < Count(Fields!Rank_Math.Value, "DataSet_C1003") * 0.3,
    "fail")
    =Switch( 
    Fields!Rank_Physics.Value >= Count(Fields!Rank_Physics.Value, "DataSet_C1003") * 0.6,
    "1st division",
    Fields!Rank_Physics.Value < Count(Fields!Rank_Physics.Value, "DataSet_C1003") * 0.6 And 
    Fields!Rank_Physics.Value >= Count(Fields!Rank_Physics.Value, "DataSet_C1003") * 0.4,
    "2nd division",
    Fields!Rank_Physics.Value < Count(Fields!Rank_Physics.Value, "DataSet_C1003") * 0.4 And 
    Fields!Rank_Physics.Value >= Count(Fields!Rank_Physics.Value, "DataSet_C1003") * 0.3,
    "3rd division",
    Fields!Rank_Physics.Value < Count(Fields!Rank_Physics.Value, "DataSet_C1003") * 0.3,
    "fail")
    =Switch( 
    Fields!Rank_Chemistry.Value >= Count(Fields!Rank_Chemistry.Value, "DataSet_C1003") * 0.6,
    "1st division",
    Fields!Rank_Chemistry.Value < Count(Fields!Rank_Chemistry.Value, "DataSet_C1003") * 0.6 And 
    Fields!Rank_Chemistry.Value >= Count(Fields!Rank_Chemistry.Value, "DataSet_C1003") * 0.4,
    "2nd division",
    Fields!Rank_Chemistry.Value < Count(Fields!Rank_Chemistry.Value, "DataSet_C1003") * 0.4 And 
    Fields!Rank_Chemistry.Value >= Count(Fields!Rank_Chemistry.Value, "DataSet_C1003") * 0.3,
    "3rd division",
    Fields!Rank_Chemistry.Value < Count(Fields!Rank_Chemistry.Value, "DataSet_C1003") * 0.3,
    "fail")

     


    I would suggest that you create a ranked list of each student's grades in each subject for each class (note that it's an ascending list with the smaller ones at the front), and based on the order of the ranked list you can determine what level the student's grades are at in his/her class.

     


    Regarding the fact that different types of your data sources will require different ways of loading data, you could refer to the following links
    URL:
    Power BI Paginated Reports with Excel or CSV file ... - Microsoft Fabric Community
    Power BI Paginated Reports with Excel Source (mssqltips.com)

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

    Best Regards,

    Carson Jian,

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Ray_Minds's avatar
    2 years ago

    Please follow the below steps :-
    1.You will need to create sample data in SQL server.
    2. Import data into Paginated Power BI Builder.
    3. Create Total Marks =Fields!Math.Value+Fields!Physics.Value+Fields!Chemistry.Value
    4. Percentage =Fields!TotalMarks.Value/300*100
    5. Division =IIF(Fields!Percentage.Value >= 60, "1st Division", IIF(Fields!Percentage.Value >= 40, "2nd Division", IIF(Fields!Percentage.Value >= 30, "3rd Division","Fail")))

    If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.