Category:Max Richter albumsQ:
Power BI: How to set a filter to an Id column in a table that has multiple rows in Power BI?
I have a Power BI table that has a column which is an Id column. When the data is loaded to the table, the ID is null.
I have a requirement where I need to filter the table to show only those records that have a certain ID.
This is how I have tried to do that:
But the filtering fails.
Is there any other way to filter by a particular Id column?
A:
Use the Filter option:
You can also create a measure called Indicate_Indicator that outputs a binary variable value, using the below logic:
Indicate_Indicator =
IF (
[MyTable].[Indicator] = 0,
1,
0
)
Then, use this indicator in a filter.
Since you have an Id column, you need to create a measure called Id
that returns the Id of a row, you can do that using the following
formula:
[Id] =
VAR Indicator = [MyTable].[Indicator]
VAR Value =
IIF(Indicator = 1,
[Indicator],
0)
RETURN [MyTable].[Id] & ";" & Value
Now you can use this measure in a filter, for example:
FILTER(MyTable, [Id] > 20)
The logic used by my measure Indicate_Indicator is based on this article.
Some more links for you:
Set a measure to return NULL when a calculated column equals zero
VAR function in Power BI: when to use IIF, I, E, and something else?
How to use VAR function in Power BI?
Christian Fuchs
Christian Fuchs (born 17 December 1973 in Tübingen) is a German football coach and former footballer.
Coaching career
Kapfenberger SV
Fuchs was manager of TSV Kapfenberger from 2008 until the end of the 2008–09 season.
1. FC Kaiserslautern
On 17 July 2009 he was appointed manager of 1. FC Kaiserslautern on a two-year contract. Fuchs announced ac619d1d87
Related links:
Comentários