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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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/

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/

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors