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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
RubenSO
Microsoft Employee
Microsoft Employee

DAX Measure Ignoring one specific

Hey community!
I've been struggling with a measure that in theory shoulnd't be a problem. 
I have a measure called "DM Sold Hours" that I use for a table with data by Area and I want another one that use it but ignoring the subsidiary level.
For example this sample of the data, I want all subsidiaries from LAT to be equal to 100 (90+10)  and AS to be 50 (20+30)
I tried with ALL, SELECTEDVALUE, and FILTER functions inside CALCULATE but not sure it doesn't work.

ZoneCountryDM Sold HoursWanted Ouput
LATArgentina90100
LATColombia10100
ASJapan2050
ASChina3050
2 ACCEPTED SOLUTIONS
vojtechsima
Super User
Super User

Hi, @RubenSO 
try this measure:

New Output = 
var currrentZone = SELECTEDVALUE('Table'[Zone])
var _sum = SUMX(FILTER(ALL('Table'), 'Table'[Zone] = currrentZone), 'Table'[DM Sold Hours])

return _sum

vojtechsima_0-1736290329565.png

 

View solution in original post

Hi @RubenSO ,

 

According to your statement, I think your issue is that you want to keep filter in your measure. 

I think you can try ALLSELECTED() FUNCTION.

New Output =
VAR currrentZone =
    MAX ( 'Table'[Zone] )
VAR _sum =
    SUMX (
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Zone] = currrentZone ),
        'Table'[DM Sold Hours]
    )
RETURN
    _sum

 

Best Regards,
Rico Zhou

 

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

4 REPLIES 4
vojtechsima
Super User
Super User

Hi, @RubenSO 
try this measure:

New Output = 
var currrentZone = SELECTEDVALUE('Table'[Zone])
var _sum = SUMX(FILTER(ALL('Table'), 'Table'[Zone] = currrentZone), 'Table'[DM Sold Hours])

return _sum

vojtechsima_0-1736290329565.png

 

Thanks for this formula!
Seems I'm facing another issue here, because my report has another filters by report level to excluded no current rows  like [customer actives], [Agent Name], [customer excluded] are the main ones. I tried to use ALLEXCEPT but doesn't seem to work because the ouput it's like a bigger number that the expected one.

Hi @RubenSO ,

 

According to your statement, I think your issue is that you want to keep filter in your measure. 

I think you can try ALLSELECTED() FUNCTION.

New Output =
VAR currrentZone =
    MAX ( 'Table'[Zone] )
VAR _sum =
    SUMX (
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Zone] = currrentZone ),
        'Table'[DM Sold Hours]
    )
RETURN
    _sum

 

Best Regards,
Rico Zhou

 

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

Thank you!
The value was a little bit different but adjusted with CALCULATE and using ALLSELECTED did the trick! 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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