Forum Discussion
Filter by selected rows
Hi there,
i have two charts (histograms) about the same fact table. (Fields: Positionnumber, Month, Value). Theres also dimTable for the Positiondata (Key positionnumber)
The first charts shows the count for this month, and the second chart shows the next month,
CountCurrentMonth = CALCULATE(COUNT('fact'[Positionnumber]), 'fact'[Month] = DATE(YEAR(today()), month(today()), 1), 'fact'[Value] >= 0,'fact'[Value] < 1)CountNextMonth = CALCULATE(COUNT('fact'[Positionnumber]), 'fact'[Month] = DATE(YEAR(today()), month(today()) + 1, 1), 'fact'[Value] >= 0,'fact'[Value] < 1)
Now when i select the first bar in the first chart, PowerBi highlights the second chart based on the selected value (0%) of the first chart.
But what I'm trying to achieve is to get the second chart highlighted by the positionnumber, instead of the value. In other words, I want to see how positions with low % in this month are filled in the next month.
P.S.
I want to keep all other filters on the page, like a customer slicer (field from dim positiondata) and i want to avoid cross filtering, because i have a second fact table in my data model.
Denise_
Ok, then you can create a calculated column of the next month's bins as followsYou may select a month to analyze it along with the next month as follows
See attached sample file
7 Replies
- tamerj1Community Champion
Hi Denise_
I believe the following should be helpfulUsing cross highlight with order and delivery date in Power BI - YouTube
- Denise_New Member
In the video he got 2 fields in the fact, which he wants to compare (order date / delivery date). And so he can duplicate his DimTable (dimDate) for his relations. I can't implement this, because I only have 1 field for the relations.
In my case, my fact table looks like:Positionnumber Month Value Value (bins 0.2) 123 01.08.2023 10% 0% 456 01.08.2023 50% 40% 123 01.09.2023 40% 40% 456 01.09.2023 10% 0%
When i select the first bar in the histogram for August (0-20%), i wanna see the value of the Positionnr "123" in the second chat (filtered for September).
I tried arround to use the DimPositiondata for that and a measure with crossfilter likeCountCurrentMonthCross = CALCULATE( COUNT( 'Positiondata'[Planposition]), CROSSFILTER('Füllgrad'[Planposition], Positiondata[Planposition], Both), 'Füllgrad'[Month] = DATE(YEAR(today()), month(today()), 1), 'Füllgrad'[Value] >= 0,'Füllgrad'[Value] < 1 )CountNextMonthCross = CALCULATE( COUNT( 'Positiondata'[Planposition]), CROSSFILTER('Füllgrad'[Planposition], Positiondata[Planposition], Both), 'Füllgrad'[Month] = DATE(YEAR(today()), month(today()) +1, 1), 'Füllgrad'[Value] >= 0,'Füllgrad'[Value] < 1 )But the second chart still gets filtered by the selected value of the x-axis when I select the first bar in the first chart.
I tried around with ALL(), ALLSELECTED(), REMOVEFILTERS(), etc. but this messes up the whole chart (all bars get the same size, etc.)