Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

all measure

Hi there,

 

I need a column chart to show accident by year, and a multi-row card to show the number of selected year.

Please advise how to write the measure. Thank you

 

Here is my data

  • Hi, Anonymous 

    Try to create measures like this:

    cat1 = 
    CALCULATE(SUM('Table1'[Number]),FILTER(ALLSELECTED(Table1),'Table1'[Category]="Fatal Accident"))
    cat2 = 
    CALCULATE(SUM('Table1'[Number]),FILTER(ALLSELECTED(Table1),'Table1'[Category]="lnjury w/o Lost Time Accident"))
    cat3 = 
    CALCULATE(SUM('Table1'[Number]),FILTER(ALLSELECTED(Table1),'Table1'[Category]="Lost Time Accident"))


    Result:

    Please refer to the attachment below for details.

    Hope this helps.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


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

2 Replies

  • Anonymous ,

    You can use year from date hierarchy

    or

    year = year([Date])

     

    Use that on axis

    Catrgory legend

    and Sum(Table[Number])+0 , measure on values

     

    Multi-row car you should build on category , it should filter selected year

     

    if you want slicer not to filter stop interactions

  • Hi, Anonymous 

    Try to create measures like this:

    cat1 = 
    CALCULATE(SUM('Table1'[Number]),FILTER(ALLSELECTED(Table1),'Table1'[Category]="Fatal Accident"))
    cat2 = 
    CALCULATE(SUM('Table1'[Number]),FILTER(ALLSELECTED(Table1),'Table1'[Category]="lnjury w/o Lost Time Accident"))
    cat3 = 
    CALCULATE(SUM('Table1'[Number]),FILTER(ALLSELECTED(Table1),'Table1'[Category]="Lost Time Accident"))


    Result:

    Please refer to the attachment below for details.

    Hope this helps.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


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