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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
marcuspaula
Frequent Visitor

Measure Totals in a table visual using Field Parameters

Hello, community!

 

Is there a way to dynamically calculate totals in a table using Field Parameters?

 

I have the following data:

marcuspaula_0-1689884895797.png

 

The following Field Parameter:

 

Parameter - Dimensions = {
    ("Category1", NAMEOF('Table'[Category1]), 0),
    ("Category2", NAMEOF('Table'[Category2]), 1)
}

 

 

And the following measures:

 

.Sum = 
SUM('Table'[Value])-50

 

 

 

.Sum Field Parameter = 
VAR __table = 
    SUMMARIZE(
        'Parameter - Dimensions',
        'Parameter - Dimensions'[Parameter - Dimensions Fields],
        "@row",[.Sum]
    )
RETURN
IF(
    HASONEVALUE('Parameter - Dimensions'[Parameter - Dimensions Fields]),
    [.Sum],
    SUMX(__table,[@row])
)

 

 

And this is the result (3500) I was expecting for my second measure on a Matrix visual:

marcuspaula_0-1689882696732.png

 

And the result I would expect if selecting Category1 (3450):

marcuspaula_1-1689882901293.png

 

PS. if I use the following

 

.Sum Field Parameter := 
SUMX(
    VALUES('Table'[Category1]),
    [.Sum]
)

 

marcuspaula_0-1689980602679.png

 

I have the desired result for the total row (which is the sum of rows). But I would like to dynamically change the column in the SUMX to whatever is selected on the field parameter if possible.

 


@Greg_Deckler 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @marcuspaula,

I'd like to suggest you add switch function to your measure formula to interact with field parameter filter effects and redirect to different calculations:

How to dynamically switch between measures in Power BI visuals with Field Parameters | endjin - Azur...

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

HI @marcuspaula,

I'd like to suggest you add switch function to your measure formula to interact with field parameter filter effects and redirect to different calculations:

How to dynamically switch between measures in Power BI visuals with Field Parameters | endjin - Azur...

Regards,

Xiaoxin Sheng

Hi @Anonymous,

 

I was trying to avoid the SWITCH since I have like 30 different scenarios but it looks like this is the way to get this working. 

 

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.