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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
OceanExplorer
Helper I
Helper I

Visual Calculation - how to group sales on a table visual

Hi, in this table visual, both columns are created from visual calculation:

Screenshot 2025-02-26 155407.png


I want to add a new visual calcualtion column that sum sales by territory, desired output:

Screenshot 2025-02-26 155412.png

 

I wrote DAX quries such as below and researched PARTITIONBY function, but non works. Since the columns in this table visual are derived from visual calculations, I can't use Matrix. Is there a way to write a DAX for this new visual calculation column?

Sales by Territory = 
CALCULATE(
    SUM([Credit Amount]),
    [Row Label]
)
 
1 ACCEPTED SOLUTION

hello @OceanExplorer 

 

try this in visual calculation.

Irwan_2-1740701870127.png

Irwan_1-1740701677435.png

 

Hope this will help.

Thank you.

View solution in original post

5 REPLIES 5
Irwan
Super User
Super User

hello @OceanExplorer 

 

please check if this accomodate your need.

Irwan_0-1740613243186.png

 

create a new measure with following DAX.

Sales Amount by Territory = 
var _Territory = SELECTEDVALUE('Table'[Sales Territory])
Return
SUMX(
    FILTER(
        ALL('Table'),
        'Table'[Sales Territory]=_Territory
    ),
    'Table'[Sales Amount]
)
 
Hope this will help.
Thank you.

Thanks, Irwan! The measure doesn't work as the fields were not in the model but generated from the table visual, so we can't refer them in a measure. I created a sample report, the Sales Territory (new) and Sales Amount (new) were visual calculations too. 

Screenshot 2025-02-27 150125.png

hello @OceanExplorer 

 

try this in visual calculation.

Irwan_2-1740701870127.png

Irwan_1-1740701677435.png

 

Hope this will help.

Thank you.

Thanks a lot! This DAX works for our requirement. Just one more question, the column that used in PARTITIONBY() has to be the original field in the data model, correct? We can't partition by a visual calculation derived column, right? 

hello @OceanExplorer 

 

Glad to be a help.

And yes it has to be original field as far as i know.

 

Thank you.

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.