I have a Clustered column chart and for the Legend field and have to switch between 2 columns based on a slicer:
if no slicer is filtered then use column0 for Legend
if slicer is filtered then use column1 for Legend
I tried adding a calculated column like this
Column = IF(ISFILTERED(Table1[slicer]) = TRUE(), Table1[column1], Table1[column0])
And then use this column as Legend.
But this doesn't work!
Can you please advice me how to do it right?
You can't filter calculated columns by slicers.
Calculated columns are only calculated once - when you load/refresh your data model. After that, they contain fixed, static values that can not respond to slicers.
To achieve your goal, you will need to redesign your chart using measures, not calculated columns. Then your formula will look like this:
[Measure to Chart] = IF(ISFILTERED(Table1[slicer]), [Measure 1], [Measure 2])
If you want more help, I would recommend to post another question with more information about your data model and desired outcome.
Related
I have a DAX table "Sumtable" that calculates the the number of rows in "Maintable" for two cases: (1) all rows in Maintable and (2) the subset of rows where Cat = "A".
Sumtable = {
("Full set", COUNTROWS(Maintable)),
("Subset", COUNTROWS(FILTER(Maintable, Maintable[Cat] = "A")))
}
I want to viz Sumtable and make it respond to filter settings on Maintable. For example when I select Maintable[Sex] = "Male" the totals in Sumtable should reflect that. What is the right way to accomplish this?
For example when I select Maintable[Sex] = "Male" the totals in Sumtable should reflect that.
Just make this two measures instead of a calculated table.
If you want these measures to appear under Sometable, you can create a one-row, one-hidden-column table with two measures, instead of two calculated columns.
And when you hide all the non-measure columns on a table it becomes a "Measure Table" with a differentiated icon.
Solved it with this: analytics-tuts.com/bar-chart-using-measures-in-power-bi
I have a problem with a measure I'm currently working on.
I have 2 sheets, I drillthrough from sheet1 to sheet2 on column_A, but I also have synced slicers on both sheets for column_A that I use.
My measure needs to get all the selected values from column_A from sheet1, but when I'm on sheet2 I can only get the available values for the subgroup of column_A that I drilled through on or all the values using ALL()
Is there a way to get the original selection?
There may be a more elegant solution, but you could filter the first page by a duplicate table, here Table2
and the main page
and the drilldown page with the measure
Measure = calculate( max('Table'[column_A]), REMOVEFILTERS('Table'), KEEPFILTERS(Table2))
I have a table Numbers and a slicer "num" to filter to a single number.
Then I have a second table Exhibitors with their exhibitorID and size.
Depending on their size I need to rate them. The rating has to depend on the slicer "num":
I need to do this with a calculated column (Expected outcome in GREEN).
Trying something like this did not work:
Calculated Class =
IF(Exhibitor[Space] >= max('Numbers'[num]), "A", "B")
Can someone help me with that calculated column?
Since Calculated Columns are populated at Refreshing the data, Slicer have no impoact on Columns. Only Measures can be affected by Slicer.
So it has to be a complicated Measure for my Visuals.
Thank you.
I've looked all over and can't find a way to do this.
In the table, I have all postcodes throughout the UK and a calculated column that concatenates from another table the products' that have been purchased in that location.
I need to filter the table to hide rows where the value selected in the slicer is in the concatenated column. I think this needs to be a measure and have tried using CONTAINSSTRING but nothing seems to be working.
Latest measure that I have tried is:
=IF(CONTAINSSTRING([Concatenated Values],[Selected Slicer Value]),"Hide","Show")
Does anyone have any ideas?
Example tables and expected results:
You can link the "another table" (the one with the products (not concatenated) per area) to the Area table.
Just change the filter option to: cross-filter direction: both
Then you can use it in your slicer.
Follow these below steps to achieve your requirement.
Let-
Your Slicer Table name: Table1
Your Details table name: Table2
Step-1: Create this following measure in Table2
show_hide_this_row =
FIND(
SELECTEDVALUE(Table1[products]),
MIN(Table2[products]),
,
0
)
Step-2: Add visual level filter using measure "show_hide_this_row" as below-
The output will be as below-
This functionality only works perfect when single selection is enabled in your slicer.
Can I have multiple charts in Power BI or create different chart types and create a parameter so that I only display 1 chart at a time. Is that a possibility within Power BI?
For example:
Year over Year
Month by Month
A measure of Month/Average as different measures.
Can I have a drop down as to which measures are selected and have the ability to be only select them one at the time?
It seems like you're asking a few questions there. I can answer one of them:
Can I have a drop down as to which measures are selected and have the ability to be only select them one at the time?
You could create a table
My Measures = DATATABLE("My Measure", STRING, {{"Measure 1"}, {"Measure 2"}})
and on that table a measure
Selected Measure = SWITCH(SELECTEDVALUE('My Measures'[My Measure], BLANK()), "Measure 1", [Measure 1], "Measure 2", [Measure 2])
and then use the [My Measure] column as a slicer (which can be a drop-down menu). Then when you select "Measure 1" from the slicer, the [Selected Measure] measure will switch to showing the values of [Measure 1].
This works best if all of the measures that you want to interchange have the same number formatting.