Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Measures - sum * Not sum

Hi All,

 

I have a problem with counting in measures.

 

I have two printouts with the same name, the number of printed pages is the same, the cost per page is e.g. 0.08
The query gives the result
day name number of pages cost

Day

Name

Number of Pages

cost pages

1

xxxx

4

0.08

3

xxxx

4

0.08

 

In the table in the Power Bi Desktop

I create tables

Name number cost per pages total cost

Name

Number of Pages

Cost of pages

TotalCost

xxxx

8

0,08

?????

 

I creat measures

TotalCost = CALCULATE(sum(query[pages])*sum(Query[costs_per_page])) is wrong sum pages and cost, when I want calculate 
TotalCost = CALCULATE(sum(query[pages])*Query[costs_per_page]) I get error

 

How to filtred or calculated? 

 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

Try this

TotalCost = CALCULATE( sum(query[pages]) * MIN(Query[costs_per_page]) )

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

2 REPLIES 2
PhilipTreacy
Super User
Super User

Hi @Anonymous 

So did my suggestion fix your problem?

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


PhilipTreacy
Super User
Super User

Hi @Anonymous 

Try this

TotalCost = CALCULATE( sum(query[pages]) * MIN(Query[costs_per_page]) )

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors