Forum Discussion
Creating table in dax based on user selected variable
- 6 years ago
Hi anandav
It seems I have fixed it!!!
please kindly use this measure based on my above post:
Measure = var a = MAXX(FILTER(ALL('Table 2'),[Month]<MAX('Table 2'[Month])&&[Bird ID]=MAX('Table 2'[Bird ID])),[NewCount]) Return IF([NewCount]=0,"No",IF(a=0,"New",IF(a>0,"Seen")))
Hi anandav
I don't think it's able to create the calculated table based on your 2 slicers: CG&AG, but I can generate the new table as your requested using another method and add the measure count :
1. Generate 2 tables then use crossjoin:
Bird ID = SUMMARIZECOLUMNS('Table'[Bird ID])
Month = SUMMARIZECOLUMNS('Table'[Month])
Table 2 = CROSSJOIN('Month','Bird ID')
Untick the Month1:
2. Add the measure:
NewCount = var a = CALCULATE(SUM('Table'[Count]),FILTER('Table',[Month]=MAX('Table 2'[Month])&&[Bird ID]=MAX('Table 2'[Bird ID])))
Return
IF(ISBLANK(a),0,a)
PBIX attached.
Thank you for the pbix file. It was helpful but still my requirement is to identify the birds as seen, not seen or new in the analysis group compared to the control group.
I am wondering whether any way to do that?
- anandav6 years agoSkilled Sharer
Greg_Deckler , Phil_Seamark , Zubair_Muhammad , Ashish_Mathur , ImkeF
Hi Experts,
As I have got good solutions from you, I am tagging you in hope of you can do the same for this problem.
Thanks in advance.
- v-diye-msft6 years agoCommunity Support
Hi anandav
It seems I have fixed it!!!
please kindly use this measure based on my above post:
Measure = var a = MAXX(FILTER(ALL('Table 2'),[Month]<MAX('Table 2'[Month])&&[Bird ID]=MAX('Table 2'[Bird ID])),[NewCount]) Return IF([NewCount]=0,"No",IF(a=0,"New",IF(a>0,"Seen")))- anandav6 years agoSkilled Sharer
Thanks al ot. That is a good solution!
I really appreciate you taking the time to solve this for me.