PowerBI Histogram with Dynamic Bins Based on Variable

73 Views Asked by At

Imagine you have the following dataset in PowerBI:

Date        Temperature (Deg C)  City 
10/01/01    5                    London
10/01/01    15                   Lisbon
10/01/01    10                   Paris
10/01/02    7                    London
10/01/02    12                   Lisbon
10/01/02    8                    Paris
...         ...                  ...

You want to create a histogram visual with in PowerBI with City as a variable in a Slicer (Filter). So as you change the city, you see the temperature distribution for that city on the histogram. However, you want to the bin size to change dynamically as you change city. Otherwise you end up with a situation where some histograms have all data in one bin etc.

From the time I have spent trying to figure this out (what seems like a critical feature missing), it seems like I can only fix the size of the bins or the number of bins (and the bin size being fixed also as a result) across all variable changes (i.e. fixed for different City values) by creating a group (bin) field.

Any insight into how this could be done would be greatly appreciated!

0

There are 0 best solutions below