Forum Discussion
naiconn1981
8 years agoRegular Visitor
Newb Question on table ranging
Hi I'm completely new to Power BI and have been playing around with it, but having trouble grouping specific data. I like to create a table where I can group specific age range. For exampl...
- 8 years ago
Hi naiconn1981,
We can create the measures as below.
Sony 10-18 = CALCULATE(COUNTROWS(Table1),FILTER(ALL(Table1),Table1[Console]="Sony" && Table1[Player's Age]>=10 && Table1[Player's Age]<=18))
Sony 19-27 = CALCULATE(COUNTROWS(Table1),FILTER(ALL(Table1),Table1[Console]="Sony" && Table1[Player's Age]>=19 && Table1[Player's Age]<=27))
Sony 28-36 = CALCULATE(COUNTROWS(Table1),FILTER(ALL(Table1),Table1[Console]="Sony" && Table1[Player's Age]>=28 && Table1[Player's Age]<=36))
Sony 37-42 = CALCULATE(COUNTROWS(Table1),FILTER(ALL(Table1),Table1[Console]="Sony" && Table1[Player's Age]>=37 && Table1[Player's Age]<=42))
Sony 43+ = CALCULATE(COUNTROWS(Table1),FILTER(ALL(Table1),Table1[Console]="Sony" && Table1[Player's Age]>=43))
For more details, please check the pbix as attached.
https://www.dropbox.com/s/hd56qny81bc8232/Newb%20Question%20on%20table%20rangin.pbix?dl=0
Regards,
Frank
v-frfei-msft
8 years agoCommunity Support
Hi naiconn1981,
We can create the measures as below.
Sony 10-18 = CALCULATE(COUNTROWS(Table1),FILTER(ALL(Table1),Table1[Console]="Sony" && Table1[Player's Age]>=10 && Table1[Player's Age]<=18))
Sony 19-27 = CALCULATE(COUNTROWS(Table1),FILTER(ALL(Table1),Table1[Console]="Sony" && Table1[Player's Age]>=19 && Table1[Player's Age]<=27))
Sony 28-36 = CALCULATE(COUNTROWS(Table1),FILTER(ALL(Table1),Table1[Console]="Sony" && Table1[Player's Age]>=28 && Table1[Player's Age]<=36))
Sony 37-42 = CALCULATE(COUNTROWS(Table1),FILTER(ALL(Table1),Table1[Console]="Sony" && Table1[Player's Age]>=37 && Table1[Player's Age]<=42))
Sony 43+ = CALCULATE(COUNTROWS(Table1),FILTER(ALL(Table1),Table1[Console]="Sony" && Table1[Player's Age]>=43))
For more details, please check the pbix as attached.
https://www.dropbox.com/s/hd56qny81bc8232/Newb%20Question%20on%20table%20rangin.pbix?dl=0
Regards,
Frank
- naiconn19818 years agoRegular Visitor
v-frfei-msft thanks Frank. I will try this. I was hoping to consign them under a bar chart but guess I can do something similar using the formulas.
- v-frfei-msft8 years agoCommunity Support
Hi naiconn1981,
Has your problem been solved, if any other question, feel free to let me know.
Regards,
Frank