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

How can I calculate the aggregation?

Hi

 

I ahve a table like this 

 

Group  Team  Countofstories   stories completed

AA          1             20                    30

AA          2             45                    25

BB           4             65                    48

BB           5             15                    30

 

How can do an divide agregation by "Group" using the last two measures?  For example for Group AA  agreagate the two teams sum--something like this : 20+45/30+25

 

Thanks

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Anonymous Maybe:

Measure =
  DIVIDE(
    CALCULATE([Measure1],ALLEXCEPT([Group]),
    CALCULATE([Measure2],ALLEXCEPT([Group]),
    0
  )

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
v-xiaoyan-msft
Community Support
Community Support

Hi @Anonymous ,

 

Does the replies above solve your problem? If it has been solved, please mark the correct reply as the standard answer to help the other members find it more quickly.Thank you very much for your kind cooperation!

 

Hope it helps,


Community Support Team _ Caitlyn

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

Greg_Deckler
Super User
Super User

@Anonymous Maybe:

Measure =
  DIVIDE(
    CALCULATE([Measure1],ALLEXCEPT([Group]),
    CALCULATE([Measure2],ALLEXCEPT([Group]),
    0
  )

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks for the answer.. I tried to use it by replacing my original dax query but I am getting this error. after line 3 was the original dax query that I needed to rewrite.

Jhon_0-1632359215649.png

 

@Anonymous, this is a fine approach but you'll need to clean up the syntax a bit to add missing parenthesis and table name references.

 

Ratio =
DIVIDE (
    CALCULATE ( [Count of stories],  ALLEXCEPT ( Table1, Table1[Group] ) ),
    CALCULATE ( [Stories completed], ALLEXCEPT ( Table1, Table1[Group] ) ),
    0
)

 

Anonymous
Not applicable

Thanks for the answer.. I tried to use it by replacing my original dax query but I am getting this error. after line 3 was the original dax query that I needed to rewrite.

 

Jhon_1-1632359279343.png

 

Your BLANK() is inside the last CALCULATE. That's what the syntax error is about.

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.