Forum Discussion

alaynanich's avatar
alaynanich
Helper I
2 years ago
Solved

Custom Aggregation in a Matrix by Using another query?

Hi PBI,   So I have a sales matrix that i want to drill down into 2 hierarhcies of data - D1 and its subgroups. The issue comes in getting the distinct counts of customers - we do not have a databa...
  • Daniel29195's avatar
    Daniel29195
    2 years ago

    alaynanich 

    output

    Measure = SWITCH(
        TRUE(),
         ISINSCOPE(DP_Level[discoveryprodcategory_id]),SUM(DP_Level[online_Customers]),
        ISINSCOPE(DC_Level[discoverydept_num]),SUM(DC_Level[online_Customers])
    )
       

     

    just need to reverse the order of the levels . 

    when using isinscope, you should always start with the lowest level ,and go  up .

     

     

    hope this helps .

     

     

    If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
    It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠