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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
marcio_fornari
Resolver I
Resolver I

Measure repeating values for table

Hello,

I have a table with 2 columns.. Type and Value

marcio_fornari_0-1611057504001.png

 

Measure 1: 

toPay = 
CALCULATE(
    SUM(PAYMENTS[value]),
    PAYMENTS[type] = "pay"
)

 

Measure 2:

toReceive = 
CALCULATE(
    SUM(PAYMENTS[value]),
    PAYMENTS[type] = "receive"
)

 

The table is reapeating values for pay and receive, why?

marcio_fornari_1-1611057647979.png

 

I think this solution is:

marcio_fornari_2-1611057671048.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@marcio_fornari , Try like

 

toPay =
CALCULATE(
SUM(PAYMENTS[value]),
filter(PAYMENTS, PAYMENTS[type] = "pay")
)

 

toReceive =
CALCULATE(
SUM(PAYMENTS[value]),
filter(PAYMENTS,PAYMENTS[type] = "receive")
)

 

refer : dataap.org/blog/2019/04/22/difference-between-calculate-with-and-without-filter-expression/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@marcio_fornari , Try like

 

toPay =
CALCULATE(
SUM(PAYMENTS[value]),
filter(PAYMENTS, PAYMENTS[type] = "pay")
)

 

toReceive =
CALCULATE(
SUM(PAYMENTS[value]),
filter(PAYMENTS,PAYMENTS[type] = "receive")
)

 

refer : dataap.org/blog/2019/04/22/difference-between-calculate-with-and-without-filter-expression/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks @amitchandak it's works!!
Thanks for the Refer too 🙂

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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