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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Help in dax grouping formulas

Hi guys,

 

Can anybody help me to create formulas from red columns ?? 

% of total transactions event_type = D2/SUMA($D$2:$D$14)

AVG from last 30 days by event type = the same rule so avarge number of transaction and grouping is by all columns with values  for example 1 row: AE,0,TEV_CREATED 

trx_snapshot_denormalized.cardInfo_countrysequenceNumbereventTypeNumber of transaction% of total transactions event_typeAVG from last 30 days by event type
AE0TEV_CREATED1914%16,5
AE1TEV_PAYMENT_INFO_UPDATED1914%12,3
AE2TEV_SECURITY_CHECK_REQUESTED1914%12,3
AE3TEV_SECURITY_CHECK_APPROVED1814%0,002
AE3TEV_SECURITY_CHECK_REJECTED11% 
AE4TEV_THREE_DS_VERIFICATION_STARTED1814% 
AE5TEV_AUTHORISATION_ATTEMPT129% 
AE5TEV_REJECTED11% 
AE6TEV_AUTHORISATION_REJECT86% 
AE6TEV_AUTHORISED43% 
AE7TEV_ACCEPTED43% 
AE7TEV_REJECTED86% 
AE8TEV_CANCELED11% 
AG0TEV_CREATED113% 
AG1TEV_PAYMENT_INFO_UPDATED113% 
AG2TEV_SECURITY_CHECK_REQUESTED113% 
AG3TEV_SECURITY_CHECK_APPROVED113% 
AG4TEV_THREE_DS_VERIFICATION_STARTED113% 
AG5TEV_AUTHORISATION_ATTEMPT113% 
AG6TEV_AUTHORISATION_REJECT113% 
AG7TEV_REJECTED113% 

 

Many thx for he

 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Solve it using :

 

% of Total transaction No group by = DIVIDE((events_tpr_card[Number of transaction]);CALCULATE(events_tpr_card[Number of transaction];All(events_tpr_card[eventType];events_tpr_card[sequenceNumber])))

View solution in original post

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

You could use EARLIER Function to create a calculate column as below:

https://docs.microsoft.com/en-us/dax/earlier-function-dax

https://powerpivotpro.com/2012/03/the-correct-usage-of-earlier/

% over transaction type column = 
 'Table'[Number of transaction] 
    / CALCULATE ( SUM ( 'Table'[Number of transaction] ), FILTER(  'Table', 'Table'[trx_snapshot_denormalized.cardInfo_country] =EARLIER('Table'[trx_snapshot_denormalized.cardInfo_country])))

For the last column. it has the same logic.

 

Regards,

Lin

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

Solve it using :

 

% of Total transaction No group by = DIVIDE((events_tpr_card[Number of transaction]);CALCULATE(events_tpr_card[Number of transaction];All(events_tpr_card[eventType];events_tpr_card[sequenceNumber])))
MFelix
Super User
Super User

Hi @Anonymous ,

 

First of all don't know if the naming of the columns is correct but I did the following measure:

% over transaction type =
SUM ( 'Table'[CountrysequenceNumbereventType] )
    / CALCULATE (
        SUM ( 'Table'[CountrysequenceNumbereventType] );
        ALL ( 'Table'[CountrysequenceNumbereventType] );
        ALLEXCEPT ( 'Table'; 'Table'[trx] )
    )

 

 Regading the last column how do you calculate the number? I can understand the formula for the first row (132 / 😎 but not for the next ones.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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