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
striker41
Frequent Visitor

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

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 @striker41 

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.

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 @striker41 ,

 

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
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.