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

DAX - Slicer option to show aggregated results

Hello everyone,

 

Is there a way I can do something like the below:

You have a slicer selection which adds columns to the report as you do multiple selections (this part I know how to do....very EASY).

 

But now, what if the user wants to see a consolidated/aggregated/summarized view for all the BUs !!!

They don't want to see all the columns added but only the total for everything.

 

Is this possible ?

 

Slicer_PBI.PNG

 

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

Because the "ALL" has no related values, we can't use a formula like that. Maybe you should rewrite it like the other two measures.

 

Avg_OT%_GL_Cond =
    if(min(GL_ALL[GL]) = "All",
        calculate(..., all(GL_ALL)), 
        averagex(...)
     )

 

 

Best Regards,

Community Support Team _ Dale
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

6 REPLIES 6
v-jiascu-msft
Employee
Employee

Hi @Anonymous ,

 

Obviously, the "All" doesn't exist. We need to create a new table to include this value. Please refer to my test below. Your formula could be this one.

BUs =
UNION ( VALUES ( 'table'[BU] ), { "All" } )

Then create a measure.

Measure 11 =
IF (
    MIN ( BUs[BU] ) = "All",
    CALCULATE ( SUM ( Sales[SalesQuantity] ), ALL ( BUs ) ),
    SUM ( Sales[SalesQuantity] )
)

DAX-Slicer-option-to-show-aggregated-results

 

 

Best Regards,

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

Hello @v-jiascu-msft,

 

Where do you put the new measure? In the new unionized table ?

 

Thanks,

 

Jason

 

 

Hello Jason,

 

It's a Matrix visual. You can put the new measure in the Values field. You can create it on your side based on the snapshot in my last post, which shows the column of each field of the Matrix.

 

Best Regards,

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

@v-jiascu-msft@v-jiascu-msft  It seems to be working but now I am having another issue and it is driving me insane....

 

I have created my new slicer using the UNION fonction + "All".

Everything is good.

 

Except:

 

I have a Daily% measure that is working for every single selection including our famous "All".

Also have a rolling average measure that is showing data for every selection except "All"

 

I do not know why this is happening and it is really frustrating.

 

 Here is a schematics so that you can better understand my predicament:

 

Capture3.PNG

 

Hi @Anonymous,

 

Because the "ALL" has no related values, we can't use a formula like that. Maybe you should rewrite it like the other two measures.

 

Avg_OT%_GL_Cond =
    if(min(GL_ALL[GL]) = "All",
        calculate(..., all(GL_ALL)), 
        averagex(...)
     )

 

 

Best Regards,

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

It became too complex so I just did a "brute force" thing.

Referenced the query, summed up and appended back to the original.

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.