Forum Discussion
afaherty
Helper V
6 years agoDAX Formula Help - Should be easy!
Hello! I am fairly new to PowerBI and DAX as well. What I am trying to accomplish is a column to calculate the number of times the "MAIN" campus appears for Fall 2019 and Spring 2020 (from the "Ter...
- 6 years ago
Have you tried making a matrix visual with Term on the rows, Campus on the columns, and making a simple measure like Campus Count = COUNTROWS(Table)? Your post requested a column, but is that needed? Many people do more columns than necessary when they first start out, which is why I'm asking.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
v-alq-msft
Community Support
6 years agoHi, afaherty
Based on your description, I created data to reproduce your scenario.
Table:
You may try measures as below.
NumMain =
COUNTROWS(
FILTER(
ALL('Table'),
OR(
'Table'[Term]="Spring 2020",
'Table'[Term]="Fall 2019"
)&&
'Table'[Campus]="MAIN"
)
)
NumOTHEX =
COUNTROWS(
FILTER(
ALL('Table'),
OR(
'Table'[Term]="Spring 2020",
'Table'[Term]="Fall 2019"
)&&
'Table'[Campus]="OTHEX"
)
)
NumOTHTU =
COUNTROWS(
FILTER(
ALL('Table'),
OR(
'Table'[Term]="Spring 2020",
'Table'[Term]="Fall 2019"
)&&
'Table'[Campus]="OTHTU"
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.