Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Need help with this filter and table link

Hello all,

 

I have a bit problem well for me that still new in this power BI (I used to use with Tableau) , since I had to migrate to Power BI, I have learning this Power BI that it is completly different than Tableau.   Anyway, I need help. please hep.  

 

I have 3 tables: 

Table 1:   

Index        Category            Type                   Value

1ENROLLEDA824
1ENROLLEDB0
1ENROLLEDC0
1ENROLLEDD0
1ENROLLEDE0
2OFFEREDA518
2OFFEREDB114
2OFFEREDC104
2OFFEREDD175
2OFFEREDE800
3ACCEPTEDA320
3ACCEPTEDB57
3ACCEPTED C35
3ACCEPTEDD56
3ACCEPTEDE334
4PARTNERA359
4PARTNERB85
4PARTNERC37
4PARTNERD57
4PARTNER E301

 

Table 2: (I create this table using Power BI for Customize/Manual Sort)

CategorySort
ENROLLED1
OFFERED2
ACCEPTED3
PARTNER 4

 

 

Table 3:  (I created this table using Power BI, with formula for %_Column =  IF('Table3'[Index]=1; BLANK();
'Table3'[Summary]/MAXX(FILTER('Table3';'Table3'[Index]=EARLIER('Table3'[Index])-1);'Table3'[Summary)*100)

This formula is to achive value in %_Column  - (1711/824)*100  207.., (802/1711)*100

 

IndexCATEGORYSUMMARY%_Column
1ENROLLED824 
2OFFERED 1711207
3ACCEPTED80246
4PARTNER839104

 

Problems:

When I did filter base on Type in Table 1:  A or B or C or D or E.   It doesn work or did not show resul in the chart.  (I am using bar chart). I know there is somehting wrong with the link or filter.  

 

How to achive so the filter would work?  pleaseeee help.   

Any help will much appreciated it!   

 

Thank you in advance.  

 

EH

14 Replies

  • Anonymous , As a new column this should have worked

    try like

    %_Column =
    'Table3'[Summary]/MAXX(FILTER('Table3';'Table3'[Index]=EARLIER('Table3'[Index])-1);'Table3'[Summary])*100

     

    Will work if Table 3 is created like this

    Table 3 = summarize(Table1, Table1[index],Table[Category],"Value",sum(Table[Value]))

    • AllisonKennedy's avatar
      AllisonKennedy
      Icon for Community Champion rankCommunity Champion

      amitchandak  Your result works, but I think the issue is that it won't filter by Type. Anonymous  Please let me know if this assessment of problem is correct? : 

      Table 1 has 5 Types (A, B, C, D, E) for each Index, and  if I'm understanding your question correctly, you want to filter the % calculation by Type. Since Table 3 has no reference/link to Type, and each type is present for each index, it won't give any different results when slicer selection changes for Type. 

       

      Anonymous Maybe you can try to explain your problem again and show example of your desired results?

      • Anonymous's avatar
        Anonymous
        Not applicable

        yes, AllisonKennedy exactly what you said... that what I encounter the problem.  What should I do?   thank you

  • AllisonKennedy's avatar
    AllisonKennedy
    Icon for Community Champion rankCommunity Champion

    Anonymous 

     

    Lots going on here. First, you need to understand the relationships between these tables, which you have not described. 

     

    Table3 is a SUMMARY table, so you cannot filter it by type, because it is at a higher level and has no reference to Type.

     

    What are you exactly trying to achieve? Do you just have the 4 indexes? If so, you could just create a MEASURE for their totals and then create measure or measures to calculate the percentages. 

  • v-xicai's avatar
    v-xicai
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    You couldn't have a calculated table or column interacted with a slicer or interaction , since calculated table or columns are only calculated when data is loaded/refreshed. 

     

    To achieve your demand, you may needn't to create another calculated table3, just create measure like DAX below in Table1, then display Table1[Category], Table1[Type], Table1[Value] and Table1[%_Result] in table visual.

     

    %_Result= 
    
    Var _LastValue=  CALCULATE(SUM('Table1'[Value]),FILTER(ALLSELECTED('Table1'),'Table1'[Category]=MAX('Table1'[Category]) &&'Table1'[Type]=MAX('Table1'[Type])&&'Table1'[Index]=MAX('Table1'[Index])-1))
    
    Var _Percent= DIVIDE( MAX('Table1'[Value]), _LastValue )*100
    
    Return
    
    IF(_LastValue<> BLANK(), _Percent , 0)

     

    Best Regards,

    Amy 

     

    Community Support Team _ Amy

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Amy,  thank you, I learn a lot in the past 3 days about Power BI,  I will try the formula that you given,  again much appreciated.  

  • v-xicai's avatar
    v-xicai
    Icon for Community Support rankCommunity Support

    Hi  Anonymous  ,

     

    Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

     

    Best regards

    Amy

    • Anonymous's avatar
      Anonymous
      Not applicable

      I will get back to you,, been bussy lately.  thank youuu..