Posts

Showing posts from March, 2023

Power BI DAX: Rank Top N Accounts with dynamic calculated index for visual filter based on user selections

Image
  DAX Formula for Video:  Account ranking index for top N number =      Var Selected_TOP_N_Number = SELECTEDVALUE('Table for Top N Selections'[Top N]) RETURN if( [Account value rank Index]<=Selected_TOP_N_Number, VALUE(1), VALUE(0)     )

Power BI DAX Formula for Dynamic Ranking Calculations Based on User Selections and Filters

Image
  The Youtube Vidoe:  Power BI DAX: Dynamic Ranking Calculations Based on User Selections and Filters         DAX formulas from the Video: Total Opp count = DISTINCTCOUNTNOBLANK('Fact'[Opportunity ID]) Total P_Revenue = SUM('Fact'[ProductRevenue]) Total F_P_Revenue = SUM('Fact'[FactoredProductRevenue]) Selected KPIs = SELECTEDVALUE('Table_KPIs'[KPI Name]) Account value rank index =      SWITCH(         TRUE(),         [Selected KPIs]="Opportunity Numbers",RANKX(ALL('Account'[Account]),[Total Opp count],,,Dense),         [Selected KPIs]="Product Revenues",RANKX(ALL('Account'[Account]),[Total P_Revenue],,,Dense),         [Selected KPIs]="Factored Product Revenues",RANKX(ALL('Account'[Account]),[Total F_P_Revenue],,,Dense)     ) Account KPI values for sorting =      SWITCH(         TRUE(),         ...