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

Join the Fabric FabCon Global Hackathonโ€”running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
smpa01
Super User
Super User

Controlling Row Subtotals both for expanded table and on any drill up and drilldown level

My sample source data is following (pbix attached)

|                        key                                  |
|------|-------|----------|-------|-----------------------|---|
| Year | site  | service  | month | key                   |   |
| 2020 | site1 | service1 | 1     | site1-service1-2020-1 |   |
| 2020 | site1 | service1 | 2     | site1-service1-2020-2 |   |
| 2020 | site1 | service2 | 1     | site1-service2-2020-1 |   |
| 2020 | site1 | service2 | 2     | site1-service2-2020-2 |   |
| 2021 | site2 | service1 | 1     | site2-service1-2021-1 |   |
| 2021 | site2 | service1 | 2     | site2-service1-2021-2 |   |
| 2021 | site2 | service2 | 1     | site2-service2-2021-1 |   |
| 2021 | site2 | service2 | 2     | site2-service2-2021-2 |   |

 

|      fact           |
|-------|-------------|
| site  | closingYear |
| site1 | 2013        |
| site2 | 2014        |

 

|                                 transaction                            |
|-------------|-------|----------|-------|-----------------------|-------|
| Year        | site  | service  | month | key                   | value |
| 2020        | site1 | service1 | 1     | site1-service1-2020-1 | 100   |
| 2020        | site1 | service1 | 2     | site1-service1-2020-2 | 200   |
| 2020        | site1 | service2 | 1     | site1-service2-2020-1 | 300   |
| 2020        | site1 | service2 | 2     | site1-service2-2020-2 | 400   |
| 2021        | site2 | service1 | 1     | site2-service1-2021-1 | 500   |
| 2021        | site2 | service1 | 2     | site2-service1-2021-2 | 600   |
| 2021        | site2 | service2 | 1     | site2-service2-2021-1 | 700   |
| 2021        | site2 | service2 | 2     | site2-service2-2021-2 | 800   |

 

The schema is following.

cap1.PNG

 

I am building a viz where I am bringing service, site, month from key and want to show what is the sum of transaction[value] and what is the fact[closingYear].

 

My measures are following 

_closingYear = 
VAR _0 =
    CALCULATE (
        MAX ( 'fact'[closingYear] ),
        TREATAS ( VALUES ( 'key'[site] ), 'fact'[site] )
    )
RETURN
    _0

transaction = CALCULATE(SUM('transaction'[value]))

 

and when i drop the measures on the viz, the expanded table looks like this

cap2.PNG

 

At this stage, how can I ask DAX to not to generate any _closingYear value on any of the expanded table as well as for drill down level

 

E.g. I don't want  any values for highlighted (i.e. row subbtotal on the expanded table, row subtotal for drill up and drill down level)

 

expanded table

cap3.PNG

drilled up

cap3.PNG

cap4.PNG

drilldown

cap5.PNG

cap6.PNG

https://drive.google.com/file/d/12QeYfgUGCDKIFEzBh7tQ74bvYd9AtFea/view?usp=sharing

 

Thank you in advance.

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @smpa01 

After my test, the total and row subtotals can only be removed from the specified column of a certain level, but it is not applicable to drill up and drill down. Unless you turn off the row subtotals in the format settings.

Ailsamsft_0-1631782171528.pngAilsamsft_1-1631782171531.pngAilsamsft_2-1631782171532.png

Ailsamsft_3-1631782171533.png

 

Best Regards

Community Support Team _ Ailsa Tao

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 @smpa01 

After my test, the total and row subtotals can only be removed from the specified column of a certain level, but it is not applicable to drill up and drill down. Unless you turn off the row subtotals in the format settings.

Ailsamsft_0-1631782171528.pngAilsamsft_1-1631782171531.pngAilsamsft_2-1631782171532.png

Ailsamsft_3-1631782171533.png

 

Best Regards

Community Support Team _ Ailsa Tao

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

smpa01
Super User
Super User

I can create following measures to determine if is in scope

isSiteinScope = if(ISINSCOPE('key'[site]),"y","n")

isServiceinScope = if(ISINSCOPE('key'[service]),"y","n")

isMonthinScope = if(ISINSCOPE('key'[month]),"y","n")

 

and then, create following measures

_closingYearRevised1 = SWITCH(TRUE(),
                                     [isSiteinScope]="y"&&[isServiceinScope]="y"&&[isMonthinScope]="y",[_closingYear]
                         
) 

_closingYearRevised2 = 
VAR _0 = SWITCH(TRUE(),
                               [isMonthinScope]="n"&&[isServiceinScope]="y"&&[isSiteinScope]="y",[_closingYear]
                                   
)
RETURN _0

_closingYearRevised3 = SWITCH(TRUE(),
                                     [isMonthinScope]="n"&&[isServiceinScope]="n"&&[isSiteinScope]="y",[_closingYear]
                                   
) 

 

But how can I make them mutually exclusive (not all the above measures [_closingYearRevised] can evaluate at the same time)?

 

cap7.PNG

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors