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

Group Aggregated Slicer Values

Hi ,

 

I have four slicer values in raw data : Tab1, Tab2,Tab3,Tab4

 

I want to show data based four Slicer Values : Tab1,Tab2,Site,Total

Formula 

Site = Tab3 +Tab4

Total = Tab1+Tab2+Tab3+Tab4

 

Any idea how to do this in Power Bi

 

Thanks

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

You can create a new table for slicer:

 

Table 2 = UNION(UNION(VALUES('Table'[Region]),ROW("Region","Site")),ROW("Region","Total"))

 

Capture.PNG

 

Then you can create the following measure:

 

 

Measure =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table 2'[Region] ) = "Tab1", CALCULATE ( SUM ( 'Table'[Actual Value] ), 'Table'[Region] = "Tab1" ),
    SELECTEDVALUE ( 'Table 2'[Region] ) = "Tab2", CALCULATE ( SUM ( 'Table'[Actual Value] ), 'Table'[Region] = "Tab2" ),
    SELECTEDVALUE ( 'Table 2'[Region] ) = "Tab3", CALCULATE ( SUM ( 'Table'[Actual Value] ), 'Table'[Region] = "Tab3" ),
    SELECTEDVALUE ( 'Table 2'[Region] ) = "Tab4", CALCULATE ( SUM ( 'Table'[Actual Value] ), 'Table'[Region] = "Tab4" ),
    SELECTEDVALUE ( 'Table 2'[Region] ) = "Site",
        CALCULATE (
            SUM ( 'Table'[Actual Value] ),
            'Table'[Region] = "Tab3"
                || 'Table'[Region] = "Tab4"
        ),
    SELECTEDVALUE ( 'Table 2'[Region] ) = "Total", SUM ( 'Table'[Actual Value] )
)

 

 

Capture1.PNG

 

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

 

Best Regards,

Dedmon Dai

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Actual Data

 

Actual ValueRegion
1Tab1
2Tab2
6Tab3
9Tab 4

 

Below Required

Actual ValueRegion 
1Tab1
2Tab2
15Site
18Total

 

Site = Tab3 +Tab4

Total = Tab1+Tab2+Tab3+Tab4

 

 

Hi @Anonymous ,

 

You can create a new table for slicer:

 

Table 2 = UNION(UNION(VALUES('Table'[Region]),ROW("Region","Site")),ROW("Region","Total"))

 

Capture.PNG

 

Then you can create the following measure:

 

 

Measure =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table 2'[Region] ) = "Tab1", CALCULATE ( SUM ( 'Table'[Actual Value] ), 'Table'[Region] = "Tab1" ),
    SELECTEDVALUE ( 'Table 2'[Region] ) = "Tab2", CALCULATE ( SUM ( 'Table'[Actual Value] ), 'Table'[Region] = "Tab2" ),
    SELECTEDVALUE ( 'Table 2'[Region] ) = "Tab3", CALCULATE ( SUM ( 'Table'[Actual Value] ), 'Table'[Region] = "Tab3" ),
    SELECTEDVALUE ( 'Table 2'[Region] ) = "Tab4", CALCULATE ( SUM ( 'Table'[Actual Value] ), 'Table'[Region] = "Tab4" ),
    SELECTEDVALUE ( 'Table 2'[Region] ) = "Site",
        CALCULATE (
            SUM ( 'Table'[Actual Value] ),
            'Table'[Region] = "Tab3"
                || 'Table'[Region] = "Tab4"
        ),
    SELECTEDVALUE ( 'Table 2'[Region] ) = "Total", SUM ( 'Table'[Actual Value] )
)

 

 

Capture1.PNG

 

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

 

Best Regards,

Dedmon Dai

 

 

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.