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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Datagulf
Responsive Resident
Responsive Resident

Working with filters in measures

Hello Community. I have a blocker on a task I am doing. So, I have a table with Internet connection clients. A single client could have one site or multiple sites. Each site is billed a different amount. The data is as below.

Client NameSites of ClientsBilled Amount($)
client AHead office1000
Client ANew York500
Client ANew Orleans2000
Client AVegas3500
Client ASeattle5000
Client AFlorida4500
Client BNew York13000
Client BSeattle2000
Client BFlorida1500
Client CWashington13700
Client CHead office3000
Client DHead office12000
Client EWashington8800
Client FFlorida11000
Client GSeattle7700
Client HNew York3300
Client HNew Orleans4000
Client HHead office3500
Client ISeattle12500

The task is to find the clients that are billed more than 10000$. WHich I have been able to do with the formulae below.

 

 

 

 

Top 10K accounts = 

SUMX(

FILTER(

GROUPBY(

'Sheet1',

'Sheet1'[Client ],

"_1", SUMX(CURRENTGROUP(),'Sheet1'[Billed Amount])

),

[_1] >= 10000

),

[_1]
)

 

 

 

 

The problem is the Matrix table only returns the sites that are above 10000, whereas the sites below 10000, also were included in the build-up of the amount to being greater than 10000. If you can help change the formula to account for the Companies with a total of 10000 change, I would be grateful. The Pbix is below. Thanks in advance. https://drive.google.com/file/d/1uRGQrGHWK8ZRX5ywCCangyflrMq3d-P8/view?usp=sharing 

2 ACCEPTED SOLUTIONS

Hi, @Datagulf 

If I understand you correctly, you can create a measure and drag it to visual filter pane as follows:

Measure1 = 
VAR a =
    CALCULATE (
        SUM ( Sheet1[Billed Amount] ),
        ALLEXCEPT ( Sheet1, Sheet1[Client ] )
    )
RETURN
    IF ( a > 10000, 1, 0 )

171.png

 

 

Best Regards,
Community Support Team _ Eason
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

Hi, @Datagulf 

If it is convenient, please show some relevant screenshots or your current file.

Do you have other filters/slicers to apply to this visual?

The measure I created is only uesed to filter the rows that meet the conditions in the original table, and will not affect the value of  Billed Amount. In addition, please check whether the fields used in your matrix are consistent with mine.173.png

Best Regards,
Community Support Team _ Eason

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@Datagulf , Try a measure like

 


Measure =
var _1 = calculate(sum('Sheet1'[Billed Amount]) ,filter('Sheet1', 'Sheet1'[Client] = max('Sheet1'[Client])))
return
sumx(filter( values('Sheet1'[Client]), _1 >10000), calculate(sum('Sheet1'[Billed Amount])))

@amitchandak , this measure does the same as the one I have.. Is there a way to have all sites to be there as long as account adds up to more than 10K.
Like the value for Sites should be seen as long as the accounts add up to more than 10K..Let me show you what it brings. 

Datagulf_0-1636114740435.png

As you can see the sites like for client B,and New York site shows 13K..

Hi, @Datagulf 

Could you please tell me whether your problem has been solved?

If you still need help, please share more details.

If it is solved, you could share your solution here and accept it as solution to close this thread.

 

Best Regards,
Community Support Team _ Eason

THanks @v-easonf-msft 

Hi, @Datagulf 

If I understand you correctly, you can create a measure and drag it to visual filter pane as follows:

Measure1 = 
VAR a =
    CALCULATE (
        SUM ( Sheet1[Billed Amount] ),
        ALLEXCEPT ( Sheet1, Sheet1[Client ] )
    )
RETURN
    IF ( a > 10000, 1, 0 )

171.png

 

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-easonf-msft , thanks. From the solution, I can see the table is okay but I get a different table when I apply the same. Don't know why.

Does the table created impact on anything?

Hi, @Datagulf 

If it is convenient, please show some relevant screenshots or your current file.

Do you have other filters/slicers to apply to this visual?

The measure I created is only uesed to filter the rows that meet the conditions in the original table, and will not affect the value of  Billed Amount. In addition, please check whether the fields used in your matrix are consistent with mine.173.png

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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