The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi I am trying to create a measure on the following
I want a multi row card to pull the following
Calculate the number of rows where the type is "Underactive", where the dept is "claims",the reason is "write off" and sum the total amount.
Thank you
Solved! Go to Solution.
CALCULATE (
SUM ( Table[cost]),
Table[Type] = "Underactive",
Table[dept]= "Claim",
Table[reason] = "Write off"
)
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Hi @gra_197 ,
Thanks for reaching out to the Microsoft fabric community forum.
I’ve revalidated your updated requirement, and you’re absolutely right the original measure shared above works perfectly to calculate the sum of cost where Type = "Underactive", dept = "Claim" and reason = "Write off". To also include the count of rows matching the same filters, I created a second measure using COUNTROWS inside the same filter logic.
Here’s the additiona measure:
Row Count Measure =
CALCULATE (
COUNTROWS ( 'DataTable' ),
'DataTable'[Type] = "Underactive",
'DataTable'[dept] = "Claim",
'DataTable'[reason] = "Write off"
)
With this, you’ll get two outputs side-by-side one for the total cost (which returns 350 in the sample data) and the other showing the number of matching records (which is 2 in this case). This way, your full requirement is completely handled. Let me know if you’d like to display both values in the same visual or combine the logic in a more dynamic format
Please find the attached pbix file for your reference.
Best Regards,
Tejaswi.
Community Support
CALCULATE (
SUM ( Table[cost]),
Table[Type] = "Underactive",
Table[dept]= "Claim",
Table[reason] = "Write off"
)
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
@FBergamaschi this is great to give me the sum, however I also need to to count the number of rows aswell
Hi @gra_197 ,
Thanks for reaching out to the Microsoft fabric community forum.
I’ve revalidated your updated requirement, and you’re absolutely right the original measure shared above works perfectly to calculate the sum of cost where Type = "Underactive", dept = "Claim" and reason = "Write off". To also include the count of rows matching the same filters, I created a second measure using COUNTROWS inside the same filter logic.
Here’s the additiona measure:
Row Count Measure =
CALCULATE (
COUNTROWS ( 'DataTable' ),
'DataTable'[Type] = "Underactive",
'DataTable'[dept] = "Claim",
'DataTable'[reason] = "Write off"
)
With this, you’ll get two outputs side-by-side one for the total cost (which returns 350 in the sample data) and the other showing the number of matching records (which is 2 in this case). This way, your full requirement is completely handled. Let me know if you’d like to display both values in the same visual or combine the logic in a more dynamic format
Please find the attached pbix file for your reference.
Best Regards,
Tejaswi.
Community Support
Very easy with another measure
CALCULATE (
COUNTROWS ( Table ),
Table[Type] = "Underactive",
Table[dept]= "Claim",
Table[reason] = "Write off"
)
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
User | Count |
---|---|
15 | |
12 | |
7 | |
6 | |
5 |
User | Count |
---|---|
24 | |
20 | |
12 | |
9 | |
7 |