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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
M_SBS_6
Helper V
Helper V

Aggregate values by Date selections

<span;>Hi, I have the following table below. As it stands using one days worth of data, this table works perfectly. My % column takes the value of a singular row and divides by the total of the value by ID.
<span;>
<span;>%=DIVIDE(
<span;>    [Value],
<span;> CALCULATE(
<span;>        SUM(Table1[Value]),
<span;>        ALLEXCEPT(Table1, Table1[ID])))

<span;>ID.   Value.   %
<span;>1         100.  10%
<span;>1.        100.  10%
<span;>1.         300.  30%
<span;>1.         500.  50%
<span;>2.         200.  40%
<span;>2.         100.  20%
<span;>2.          200. 40%

<span;>However, when I add another days worth of data in but filter on just one day (tw_date), the value reacts to the latest date and sums it correctly but the % column doesn't and it returns the percentage value based on the 2 days.

<span;>Any idea how to change this please so it reacts to the dates selected please

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@M_SBS_6 Well, I *think* the issue is your ALLEXCEPT removing the date context so probably need to include the column your slicer is based on within your ALLEXCEPT?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
v-xuxinyi-msft
Community Support
Community Support

Hi @M_SBS_6 

 

I added another date to the data you provided.

vxuxinyimsft_0-1706676499016.png

 

You can change the formula to something like this:

% = DIVIDE([Value], CALCULATE(SUM(Table1[Value]), ALLEXCEPT(Table1, Table1[ID], Table1[Date])))

 

vxuxinyimsft_1-1706676682980.png

Is this the result you expect?

 

Best Regards,
Community Support Team _Yuliax

 

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

Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

@M_SBS_6 Well, I *think* the issue is your ALLEXCEPT removing the date context so probably need to include the column your slicer is based on within your ALLEXCEPT?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.