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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Hussein_charif
Helper IV
Helper IV

filter on 1 level of a matrix

i have a matrix with the following rows :
item,year,month,day.

i have a measure called difference % that gets me the difference % on item level and on year, month and day. the itemNo difference is calculated in a different way, here is the full dax code:

Difference % =
IF(
    COUNTROWS(VALUES(valueEntry[itemNo])) = 1 &&
    NOT(
        ISFILTERED(valueEntry[valuationDate]) ||
        ISFILTERED(valueEntry[year]) ||
        ISFILTERED(valueEntry[month]) ||
        ISFILTERED(valueEntry[day])
    ),
   
    VAR CurrentItemNo = MAX(valueEntry[itemNo])
 
    VAR MinDate =
        CALCULATE(
            MIN(valueEntry[valuationDate]),
            FILTER(
                ALL(valueEntry),
                valueEntry[itemNo] = CurrentItemNo
            )
        )
 
    VAR MaxDate =
        CALCULATE(
            MAX(valueEntry[valuationDate]),
            FILTER(
                ALL(valueEntry),
                valueEntry[itemNo] = CurrentItemNo
            )
        )
 
    VAR MinDateValue =
        CALCULATE(
            DIVIDE(
                SUM(valueEntry[Cost]),
                SUM(valueEntry[itemLedgerEntryQuantity]),
                0
            ),
            valueEntry[valuationDate] = MinDate
        )
 
    VAR MaxDateValue =
        CALCULATE(
            DIVIDE(
                SUM(valueEntry[Cost]),
                SUM(valueEntry[itemLedgerEntryQuantity]),
                0
            ),
            valueEntry[valuationDate] = MaxDate
        )
 
    VAR Difference = MaxDateValue - MinDateValue

    VAR itemdiff =
            DIVIDE(
            Difference,
            MinDateValue,
            0
        )
 
    RETURN
    itemdiff,
 
    DIVIDE(
        [Difference],
        [Average],
        0
    )
)
 
i want to filter another matrix in a bookmark to show only where the item difference % is >2.5%. how can i do it?Screenshot 2024-12-04 163826.png
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Hussein_charif 

As I am not entirely clear on your data, I have created the following example:

vlinyulumsft_0-1733381707468.png

1.Firstly, you can use the following calculation columns:

Column =
IF (
    CALCULATE (
        'valueEntry'[Difference %],
        ALLEXCEPT ( 'valueEntry', 'valueEntry'[itemNo] )
    ) >= 0.25,
    1,
    0
)

2.Secondly, apply this calculated column to the visualisation object.  

vlinyulumsft_1-1733381736306.png

3.Here's my final result, which I hope meets your requirements.

vlinyulumsft_2-1733381736308.png

The final result may still need adjustments based on your data.Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

We recommend uploading it to GitHub and sharing the link with us.When uploading a file, please be careful to delete sensitive information.

 

Please find the attached pbix relevant to the case.

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi, @Hussein_charif 

As I am not entirely clear on your data, I have created the following example:

vlinyulumsft_0-1733381707468.png

1.Firstly, you can use the following calculation columns:

Column =
IF (
    CALCULATE (
        'valueEntry'[Difference %],
        ALLEXCEPT ( 'valueEntry', 'valueEntry'[itemNo] )
    ) >= 0.25,
    1,
    0
)

2.Secondly, apply this calculated column to the visualisation object.  

vlinyulumsft_1-1733381736306.png

3.Here's my final result, which I hope meets your requirements.

vlinyulumsft_2-1733381736308.png

The final result may still need adjustments based on your data.Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

We recommend uploading it to GitHub and sharing the link with us.When uploading a file, please be careful to delete sensitive information.

 

Please find the attached pbix relevant to the case.

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

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.

Top Solution Authors