Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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] )
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
22 | |
10 | |
10 | |
9 | |
7 |