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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Grand total columns - using dynamic measures (selecting within slicer)

Hi Power BI community,

 

since several days I struggle with the problem of calculating total values per each column. I have created dynamicaly selected measures using slicer. The problem relates to the total values. There is just one column which descibes total values, becasure I have used a measure with switch function inside (this way we are able to select measures within the slicer). The below two screenshots depict the described situation.

 

total_values_p1.jpgtotal_values_p2.jpg

 

Is it possible to add grand total columns per each measure in the actual situation?

 

Kind regards,

Nicr

1 ACCEPTED SOLUTION

Hi @Anonymous ,

Actually, total level is based on value fields, you can't use measure to split column fields on total level. You can consider to move one column field to row level and use row level total to instead:

dyn_measure = 
SWITCH(
    SELECTEDVALUE(dyn_values[ID]),
    1, FORMAT([V1], "#,##0"),
    2, FORMAT([V2], "#,##0"),
    FORMAT([V1]+[V2], "#,##0")
)

2.png

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

5 REPLIES 5
v-shex-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please share a pbix file with some sample data to help us clarify your data structure and test to coding formula on it.

Notice: do mask on sensitive data.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Hi @v-shex-msft,

 

I attach the pbix file with the current problem I struggle with.

 

Link: PBIX report

 

Kind regards,

Nicr

Anonymous
Not applicable

@v-shex-msft 

 

Any updates?

 

Kind regards,

Nicr

 

Hi @Anonymous ,

Actually, total level is based on value fields, you can't use measure to split column fields on total level. You can consider to move one column field to row level and use row level total to instead:

dyn_measure = 
SWITCH(
    SELECTEDVALUE(dyn_values[ID]),
    1, FORMAT([V1], "#,##0"),
    2, FORMAT([V2], "#,##0"),
    FORMAT([V1]+[V2], "#,##0")
)

2.png

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

@v-shex-msft 

 

Thanks for your help. The solution is ok, but doesn't fullfill my requirements at all, but if I have any simpler problem I won't hesitate to use it.

 

Kind regards,

Nicr

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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