The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have a problem
When selecting column in first visual, I am getting wrong visual in second visual. Second visual sum is 58163 while first visual shows 35 286. Both visuals use same measure like this:
Prekės likutis, EUR (KATEGORIJA) =
CALCULATE (
[Likutis, Eur],
FILTER (
DISTINCT (ALL(I27[I27_KODAS_PS] )),
COUNTROWS (
FILTER (
'Pasirinkti_sandeliams',
[17_1_1_Pasiskirstymas pagal kategorijas]='Pasirinkti_sandeliams'[Kategorijos]
)
) > 0
)
)
Kategorijos are
Kategorijos ar categories: filter final sum by category. So what I am doing wrong?
Hi @Analitika ,
Are the fields of both visualizations the same table? Could you please provide some example data? What are the parameters in your DAX?
Best regards,
Mengmeng Li
Hi
It looks like the issue is coming from how the filters are being applied in your DAX measure, especially when using ALL('Date') inside your CALCULATE. When you do this, you’re removing all date filters, which can accidentally ignore your category context and give the wrong totals in your visuals.
To make sure your measure respects the selected category in the visual, I recommend using KEEPFILTERS along with VALUES. This ensures that the measure only calculates within the current filter context (like the category selected in your chart or slicer).\
Try updating your measure like this (replace table/column names as needed):
Suma kategorimai =
CALCULATE(
[Suma],
FILTER(
ALL('Date'),
'Date'[Date] <= MAX('Date'[Date])
),
KEEPFILTERS(VALUES('Kategorija'[KategorijaID]))
)
This pattern will ensure you always get the correct total for the selected category in each visual, even with slicers or multiple charts on the page. If you want the measure to also respect page and report filters, you can use ALLSELECTED('Date') instead of ALL('Date') in your FILTER.
Also, double-check that your relationships between tables are correct and active.
HI,
After I am getting the same result. Here example:
The result of second visual is 34450 instead of 27789. Why I am getting wrong filtering.