Forum Discussion

Marty_H's avatar
Marty_H
Frequent Visitor
4 years ago

Column averages table with ascending values and dynamic date slicer

Hi everyone,

I have a table that contains data with daily values like this:




Now I want to create a table with the averages in ascending order that adjusts itself when moving the date slicer in my dashboard.
I know that the treemap visual works in a similair way in my dashboard, but my customer wants a table view.
On the left of my treemap visual you can see 3 failed attempts:



It must be dynamic, so when I slice for a different period in time, my table needs to adjust.
The averages need to be dynamically sorted from highest value to lowest (just like the treemap does).
The first attempt is with a table visual, but this doesn't allow me to get my columns as rows.
The second attempt is the matrix visual, but here I can't have my values sorted in ascending order.
The third attempt is a calculated column but this doesn't adjust with the slicer (see more info below)

This sounded simple but it seems like this is not that easy on power bi... 🤔

The calculated table I made has been made like this:

But tables made like this are not affected by slicers. 😔

Is there someone who can help me with this seemingly simple problem?

Here is my pbix file: Column_averages_table_ascending_values_with_date_slicer.pbix

And here are some data files:

 

Thanks in advance,
Marty

6 Replies

    • Marty_H's avatar
      Marty_H
      Frequent Visitor

      Thanks for letting me know lbendlin,
      I didn't realize it required a password.

      Now everyone should be able to download it

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        Now I see what your issue is.  You need to do some serious unpivoting with your raw data to make it useful.

         

        Can you post a couple of the files in the PBI Test Folder 2\HeatMap_Data\ folder?

  • V-lianl-msft's avatar
    V-lianl-msft
    Icon for Community Support rankCommunity Support

    Hi Marty_H ,


    Try using "Unpivot" in the query editor, and then create a measure to calculate the average.

    https://radacad.com/pivot-and-unpivot-with-power-bi 

    The calculated table and calculated column are always static, and the value cannot be changed dynamically according to the slicer. Only measure will change dynamically based on the current row context.


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