Forum Discussion

j_gan2022's avatar
j_gan2022
Frequent Visitor
4 years ago
Solved

Summarize Table as Measure

Hi I have a dataset as below   My objective is to create a histogram to calculate the number of students vs number of attendances as below. This histogram has to be dynamic to slicer date range   ...
  • amitchandak's avatar
    amitchandak
    4 years ago

    j_gan2022 , Sorry Some mistake

    Option one is a new table

     

    If you need measure

     

    meausre =
    VAR _table = SUMMARIZE(Data, Data[Student ID], "Total Attendance", COUNTROWS(Data) )
    var _count = countx(filter(_table, [Total Attendance] >=Min(MasterGroup[Min Value] ) && [Total Attendance] <=max(MasterGroup[Max Value] )),[Student ID])
    return
    _count

     

     

    ------

    If you need table

     

     

    Table = 
    VAR Table = SUMMARIZE(Data, Data[Student ID], "Total Attendance", COUNTROWS(Data) ) 
    return 
    Addcolumns(Table , "Bucket"
    [Total Attendance]	<= 10, "  0 -10" ,
    [Total Attendance]	<= 20, " 10 -20" ,
    [Total Attendance]	<= 30, " 20 -30" ,
    [Total Attendance]	<= 40, " 40 -40" ,
    //Add other 
    )