Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Analitika
Post Prodigy
Post Prodigy

Wrong visual filtering in Power BI

Hello,

 

I have a problem 

Analitika_0-1737457948346.png

 

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 

Analitika_1-1737458478839.png

Kategorijos ar categories: filter final sum by category. So what I am doing wrong?

 

4 REPLIES 4
Anonymous
Not applicable

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?

vmengmlimsft_0-1737513061757.png

 

 

 

Best regards,

Mengmeng Li

Likutis, Eur = [Suma kaupiamas]+sum(I27[I27_PIN_SUMA])
Suma kaupiamas = CALCULATE(sum('I27'[I27_PIN_SUMA]), FILTER(ALL('Date'[Date]),'Date'[Date]<MIN('Date'[Date])))
 
 
 
 
Here formulaes
 
rohit1991
Super User
Super User

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.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

HI,

 

After I am getting the same result. Here example:

Analitika_0-1737530746835.png

 

The result of second visual is 34450 instead of 27789. Why I am getting wrong filtering.

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.