The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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] )
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
21 | |
19 | |
18 | |
17 | |
12 |
User | Count |
---|---|
36 | |
34 | |
20 | |
19 | |
15 |