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

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.

Reply
Anonymous
Not applicable

Filter data with measure (pbix)

Hi,

 

could you please look at my pbix ?

https://drive.google.com/file/d/1EsHHr01aAha7_qPe7xqOiQKY4VuA57A_/view?usp=sharing

 

I want to filter a visualization (the one in yellow) with the result of a Measure (#ViewComparison, the one in red).

 

basically, first the user selects what data he wants to display. #ViewComparison is updated.

 

 

Thanks!

 

I'm new in Power BI, so if it's not the good method let me know

5 REPLIES 5
Anonymous
Not applicable

Hi,

 

on my report, the user can choose what data to display :

- area

- city

- county

- state

- country

 

Depending the selection I put in one measure the higher level :

if I select area , Measure = "city"

if i select city, Measure = "county"

....

 

My table contains all data and there's one column "Data Level"

 

On some of my visualization, I want to show data filtered on Measure. (to show a comparison with the user selection)

 

How is it possible ? unless it's not the right  method ?

 

many thanks !

 

Anonymous
Not applicable

What do you think about it ? 🙂

Hello, @Anonymous

Try this formula

#CalculVS =
SUMX (
    FILTER (
        ALL ( data );
        data[DATA_VIEW]
            = LOOKUPVALUE (
                selectionUser[LIB_VIEW];
                selectionUser[CODE_VIEW]; MAX ( selectionUser[CODE_VIEW] ) + 1
            )
    );
    data[VALUE]
)

 

Anonymous
Not applicable

Hello @popov,

 

it's nearly the solution. how can I add in this measure another filter like data[KPI] = "data1" ?

 

indeed, my chart on top left is filtered on data1, and #CalculVS is the sum of everything for my data view selected.

 

I tried with CALCULATE but it seems to work on the selection only.

 

 

Anonymous
Not applicable

How can I add another filter condition in the formula :

 

#CalculVS =
SUMX (
    FILTER (
        ALL ( data );
        data[DATA_VIEW]
            = LOOKUPVALUE (
                selectionUser[LIB_VIEW];
                selectionUser[CODE_VIEW]; MAX ( selectionUser[CODE_VIEW] ) + 1
            )
    );
    data[VALUE]
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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