cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
acanepa
Resolver I
Resolver I

Filter by columns on the fly

Hello,

 

I want to know if is possible to filter by columns for a lineor barchart.

For example let's say I have 3 measures, pageviews, visits and bounces. And I want to graph them in an line chart, but I also want to give the user the posibility to filter which measures he want to see. It's possible to do that? My past experience is more focused in Tableau and in that software you can do that with parameters.

 

Regards,

1 ACCEPTED SOLUTION
dkay84_PowerBI
Microsoft
Microsoft

You could take this approach.

 

Create a table called Measures. The contents will be 

MeasureName , MeasureID as column names

The rows will be

pageviews , 1

visits , 2

bounces, 3

 

Create a measure in the data model as follows :

 

Showvalue=switch (TRUE,
Min ( Measures[MeasureID] ) = 1,
( [pageviews] ),                            /* replace this by your fomula for pagevies or if already exists put that measurename */
Min ( Measures[MeasureID] ) = 2,
( [visits] ),                                      /* replace this by your fomula for visits or if already exists put that measurename */

Min ( Measures[MeasureID] ) = 3,

( [bounces] ) )                               /* replace this by your fomula for bounces or if already exists put that measurename */

 

Now create a slicer with Measure table column MeasureName .

 

In the chart or table , use the measure Showvalue as your values column to chart or display in table and you will have the results.

 

Credit for this solution goes to @CheenuSing

View solution in original post

7 REPLIES 7
dkay84_PowerBI
Microsoft
Microsoft

You could take this approach.

 

Create a table called Measures. The contents will be 

MeasureName , MeasureID as column names

The rows will be

pageviews , 1

visits , 2

bounces, 3

 

Create a measure in the data model as follows :

 

Showvalue=switch (TRUE,
Min ( Measures[MeasureID] ) = 1,
( [pageviews] ),                            /* replace this by your fomula for pagevies or if already exists put that measurename */
Min ( Measures[MeasureID] ) = 2,
( [visits] ),                                      /* replace this by your fomula for visits or if already exists put that measurename */

Min ( Measures[MeasureID] ) = 3,

( [bounces] ) )                               /* replace this by your fomula for bounces or if already exists put that measurename */

 

Now create a slicer with Measure table column MeasureName .

 

In the chart or table , use the measure Showvalue as your values column to chart or display in table and you will have the results.

 

Credit for this solution goes to @CheenuSing

View solution in original post

Do you know if you can filter axis?, for example percentages against whole numbers?. I'm using FORMAT but is not working.

I'm not sure what you are asking.  Try the axis options within the visual settings, or try changing the data type for the data displayed on the Y axis.  Not sure what "percentages against whole numbers" means.

Hi,

 

Sorry for explain badly. 

I'm using different meausures or metrics. A group of metrics use percentages for show data and other group of metrics use whole numbers to show data. I'm trying to format the meausures with the function FORMAT in DAX, but that converts numbers to text.

 

Thanks in advance for your response.

 

Rergards,

In the report view, if you select a measure from the "Fields" pane, then click on the "Modeling" tab, you will see an area where you can change the formatting.

Hello,

 

Thanks for your answer. But that is only when you have one type of measure, where the measures are all percentages or all whole numbers. The workaround is generating two groups of measures, with two overlapping and identical graphs. 

It's not so fancy if you need to interact with the dashboard but at least is consistent with the format along different type of measures.

 

Regards,

Works great!. Thanks for the help!.

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.