Forum Discussion

JajatiDev's avatar
JajatiDev
Helper II
3 years ago
Solved

Creating A Pareto Chart using DAX Function Combinations

Hello All, Greeting!   While exploring DAX functions, I came across this beautiful demonstration to Create A Pareto Chart In Power BI Using DAX Function Combinations from Enterprise DNA. However, ...
  • sevenhills's avatar
    3 years ago

    Try adding these two measures:

     

    NoOfOrderLines running total in Days = 
    CALCULATE(
    	SUM('Table'[NoOfOrderLines]),
    	FILTER(
    		ALLSELECTED('Table'[Days]),
    		ISONORAFTER('Table'[Days], MAX('Table'[Days]), DESC)
    	)
    )

     

    % Calc = DIVIDE([NoOfOrderLines running total in Days], Max('Table'[TotalNoOfLines]))

    and format the % measure as

     

    Table visual:

    Pareto chart visual using Line and stacked column chart

    output:

     

     

     Hope it helps!

  • sevenhills's avatar
    sevenhills
    3 years ago

    I looked into your file and tried to understand some and could not get what is target of 90%. 

     

    Providing the details of measures, tune the names and syntax for your needs.

     

     

    1. Counts Full Consolidation at Origin = 
    VAR FullOrderConsolidation = FILTER(
                                     SUMMARIZE('DataTable','DataTable'[Order_ID], 'DataTable'[Delivery_Type]), 
                                     'DataTable'[Delivery_Type] = "Full consolidation at origin")
    
    Return COUNTROWS(FullOrderConsolidation)

     

     

     

    1. Counts Ship as Available = 
    
    VAR ShipAsAvailable = FILTER('DataTable', 'DataTable'[Delivery_Type] = "Ship as available")
    
    Return COUNTROWS(ShipAsAvailable)

     

     

     

    2. No of order lines = [1. Counts Ship as Available] + [1. Counts Full Consolidation at Origin]

     

     

     

    3. Cumulative Total No of order lines = 
    CALCULATE( [2. No of order lines], FILTER( ALLSELECTED('DataTable'), 'DataTable'[SC_TAT] <= MAx('DataTable'[SC_TAT])))

     

     

     

    3. Running % CT and Total = 
    DIVIDE( [3. Cumulative Total No of order lines], CALCULATE( [2. No of order lines], ALLSELECTED('DataTable') ), BLANK())

     

     

    Sample output:

     

     

    Note: You have to check your requirements as SC_TAT going up to 400 values on x-axis, which is not good in my view. 

     

    Hope this helps!