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
nicolasvc
Helper III
Helper III

Sum by month in different table and calcule percentage

I have two tables that contain the income of two types of products, and a third table with the income goal to generate per month. This is why I need to calculate the monthly income of both tables and then use the third one to calculate the percentage of fulfillment.

Table 1 and 2, the name of the product varies between A and B (I know it is not optimal to have it in separate tables, but there are other fields that need to be separated)

DateProductIncome
01-01-2022A1000
02-01-2022A2000
.........
06-06-2022A2000

 

Table 3

DateProductGoal
01-2022A4000
 ......
01-2022B5000

 

What I tried is to make an array with the date filter, it works for me but when calculating the percentage of the goal I can't, and doing it with dax I don't know how to do it

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @nicolasvc ,

 

According to your description, refer to the following test results to see if they meet your needs:

M = 
VAR sel =
    CALCULATE (
        MAX ( Table_D[Goal] ),
        SELECTEDVALUE ( Table_D[Product] ) = Table_D[Product]
    )
RETURN
    IF (
        SELECTEDVALUE ( Table_D[Product] ) = MAX ( TableA[Product] ),
        DIVIDE ( MAX ( TableA[Income] ), sel, BLANK () ),
        BLANK ()
    )

vhenrykmstf_0-1654846955338.png

If the problem is still not resolved, please provide test data and screenshots of desired results. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-henryk-mstf
Community Support
Community Support

Hi @nicolasvc ,

 

According to your description, refer to the following test results to see if they meet your needs:

M = 
VAR sel =
    CALCULATE (
        MAX ( Table_D[Goal] ),
        SELECTEDVALUE ( Table_D[Product] ) = Table_D[Product]
    )
RETURN
    IF (
        SELECTEDVALUE ( Table_D[Product] ) = MAX ( TableA[Product] ),
        DIVIDE ( MAX ( TableA[Income] ), sel, BLANK () ),
        BLANK ()
    )

vhenrykmstf_0-1654846955338.png

If the problem is still not resolved, please provide test data and screenshots of desired results. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.