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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Create DAX subtotal measure based on 2 columns

I have 2 columns

 

[Franchise] and [Metier] in table 'Product mapping 

I also created a combined column which i do not want in my visual. 

 

When i add the combined column to the visual It shows the correct value. 

When i remove it it doesn't. 

 

SO i am trying to write a measure that calculates a subtotal based on the 2 individual columns. 

I have a measure [2022 units] in table '2021/2022 Aug YTD Product P&L to sum up.

 

2022 subtotal Units =
CALCULATE(
      sum('2021/2022 Aug YTD Product P&L'[2022 Units])
          ,
REMOVEFILTERS('2021/2022 Aug YTD Product P&L')
          ,
FILTERS('Product Mapping'[Filter F-M]))                           --- this is the combined field

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please have a try.

test =
VAR currentitem =
    SELECTEDVALUE ( 'Product Mapping'[Filter F-M] )
RETURN
    CALCULATE (
        SUM ( '2021/2022 Aug YTD Product P&L'[2022 Units] ),
        FILTER (
            ALL ( '2021/2022 Aug YTD Product P&L' ),
            'Product Mapping'[Filter F-M] = currentitem
        )
    )

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

Please have a try.

test =
VAR currentitem =
    SELECTEDVALUE ( 'Product Mapping'[Filter F-M] )
RETURN
    CALCULATE (
        SUM ( '2021/2022 Aug YTD Product P&L'[2022 Units] ),
        FILTER (
            ALL ( '2021/2022 Aug YTD Product P&L' ),
            'Product Mapping'[Filter F-M] = currentitem
        )
    )

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

 

Anonymous
Not applicable

tried this too but this only gives back the value of the current row
 
test =

VAR currentitem = SELECTEDVALUE('Product Mapping'[Filter F-M])
RETURN

CALCULATE (SUM('2021/2022 Aug YTD Product P&L'[2022 Units]),
    'Product Mapping'[Filter F-M] = currentitem
)

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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