Forum Discussion

nicolasvahidzei's avatar
nicolasvahidzei
Frequent Visitor
2 years ago
Solved

Filter by column and dynamic average

Hello everyone,

 

i was not able to find a solution online to my query. 

I have multiple trucks listed per licence plate and i have the days of the months numbered 1 through 31.

 

I want to add a slicer for the dates but they are column names and i am not sure how to do that. I need the selected date range to only show those selected date range and hide the others.

 

Once that is done a column should be added to calculate the average for that truck.

 

Is such an operation possible?

 

Thank you so much for your time.

 

  • Hi nicolasvahidzei 
    You need to unpivot your table from PQ ( The days must be on rows):

    Change the column name for Day:

    After closing and applying create the measure (not Calculated column) for the average :

    Average_ = AVERAGE('Table'[Value])
    And drag The vech, days and average to the matrix:

    Add a slicer for days :

    The pbix with the example is attached

    Detailed guide to unpivot :
    https://www.youtube.com/watch?v=tAIqopmj9RA&t=17s

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

4 Replies

  • Hi nicolasvahidzei 
    You need to unpivot your table from PQ ( The days must be on rows):

    Change the column name for Day:

    After closing and applying create the measure (not Calculated column) for the average :

    Average_ = AVERAGE('Table'[Value])
    And drag The vech, days and average to the matrix:

    Add a slicer for days :

    The pbix with the example is attached

    Detailed guide to unpivot :
    https://www.youtube.com/watch?v=tAIqopmj9RA&t=17s

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