Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I need to use a filter on the aggregation of a column. I need to achieve two things with this filter:
- It should be possible to aggregate the column in different ways, and the filter should always work on the current level of aggregation. I can achieve this if I use a measure instead of a column, but then I cannot use the measure to filter at page level instead of at visual level.
- I need to apply that filter to a second visual that has the same aggregation levels as the first one but that shows a different measure.
To be more specific, I attach a file where the data and a page with two visuals is contained:
https://drive.google.com/open?id=1vXBSL4Xchto5swl7qq2iHDlxWV1Wibx3
I have built two columns as:
I need to be able to filter at page level (not at visual level) on "sum of n_articles", where the aggregation level for "n_articles" changes as the user drills down the hierarchy levels or as the user applies other filters to the data.
Solved! Go to Solution.
Hi @Anonymous ,
We can not make the field filter in page level with an aggregated value, but we can provide a workaround based on your description:
1. create a calculated table to filter:
Filter_N_Articles_Table =
GENERATESERIES ( 0, SUM ( Tabelle1[n_articles] ), 1 )
2. Then we create measure used in the chart:
Sum_N_Articles =
VAR result =
SUM ( 'Tabelle1'[n_articles] )
RETURN
IF ( result IN FILTERS ( 'Filter_N_Articles_Table'[Value] ), result, BLANK () )
Sum_Error_Articles =
IF (
SUM ( 'Tabelle1'[n_articles] ) IN FILTERS ( 'Filter_N_Articles_Table'[Value] ),
SUM ( Tabelle1[n_errors] ),
BLANK ()
)
n_errors_per_article =
IF (
SUM ( Tabelle1[n_articles] ) IN FILTERS ( Filter_N_Articles_Table[Value] ),
DIVIDE ( SUM ( Tabelle1[n_errors] ), SUM ( Tabelle1[n_articles] ), 0 ),
BLANK ()
)
3. Then we can use the Value Field of Filter_N_Articles_Table in the Page Level Filter
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
We can not make the field filter in page level with an aggregated value, but we can provide a workaround based on your description:
1. create a calculated table to filter:
Filter_N_Articles_Table =
GENERATESERIES ( 0, SUM ( Tabelle1[n_articles] ), 1 )
2. Then we create measure used in the chart:
Sum_N_Articles =
VAR result =
SUM ( 'Tabelle1'[n_articles] )
RETURN
IF ( result IN FILTERS ( 'Filter_N_Articles_Table'[Value] ), result, BLANK () )
Sum_Error_Articles =
IF (
SUM ( 'Tabelle1'[n_articles] ) IN FILTERS ( 'Filter_N_Articles_Table'[Value] ),
SUM ( Tabelle1[n_errors] ),
BLANK ()
)
n_errors_per_article =
IF (
SUM ( Tabelle1[n_articles] ) IN FILTERS ( Filter_N_Articles_Table[Value] ),
DIVIDE ( SUM ( Tabelle1[n_errors] ), SUM ( Tabelle1[n_articles] ), 0 ),
BLANK ()
)
3. Then we can use the Value Field of Filter_N_Articles_Table in the Page Level Filter
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
That was really helpful. Thanks a lot!
Hello @v-lid-msft
I need to generate some cards now that show the total number of articles, errors and errors per article after applying the filter. This is best illustrated with this screenshots:
Without filter, everything looks fine:
With filter value > 30, the results is not as expected:
With filter value < 10:
I understand that it doesnt work as I would like because the filter is applied directly to the cards. Instead, I would like that the cards refer to the content of the other visuals. Can you help me with this?
Here is the link to the file: pbix_file
Thanks a lot
Hi @Anonymous ,
Sorry for that, the reason is that the card visual will calculate for total, but the column chart will aggrerate and filter for each level, we can use formula to let this card visual show correct value when the column chart is in level computer_char_3, but it is impossible to let it change when drill down to next level in column chart because the card visual cannot know the drill level of other chart.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
thanks a lot for the clarification. That helps.
Best regards
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |