Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I want to be able to create a calculation at row level in a measure without adding a calculated column. In my Patient data, I want to calculate the sum of patients for each month but before calculating sum, I want to apply a condition at row level which is Max(Patients, 0).
I am able to achieve this using the following measure -
Solved! Go to Solution.
@Pdawar Sorry yes that will not work.
For having that flexibility to use filter from dimension row wise. You can try using CALCULATETABLE DAX function.
I tried this logic to filter but this doesn't work because the first argument of filter function is to provide the table name and in this case we are not providing a table for Product column.
@Pdawar Sorry yes that will not work.
For having that flexibility to use filter from dimension row wise. You can try using CALCULATETABLE DAX function.
@Pdawar You can apply those filter inside FILTER DAX Fuction and then apply the SUMX on that filtered table. You can try the below formula.
Max at row level =
var _filteredPatientstable = FILTER(Patients,Patients[TYPE]="Paid" && Patients[Product]="Product A")
return
SUMX(_filteredPatientstable, MAX(Patients[Patients] )
Thank you! And can filter from another table can also be applied? So the data model is star schema and the product filter needs to be applied from the Product table.
@Pdawar If the data model is star schema then you can apply the filter condition in FILER DAX function from Product dimension. But there needs to be relationship between fact and dimesion.
for example :
Max at row level =
var _filteredPatientstable = FILTER(Patients,Patients[TYPE]="Paid" && product[Product]="Product A")
return
SUMX(_filteredPatientstable, MAX(Patients[Patients] )
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
13 | |
12 | |
11 | |
10 | |
8 |