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.
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)
Date | Product | Income |
01-01-2022 | A | 1000 |
02-01-2022 | A | 2000 |
... | ... | ... |
06-06-2022 | A | 2000 |
Table 3
Date | Product | Goal |
01-2022 | A | 4000 |
... | ... | |
01-2022 | B | 5000 |
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
Solved! Go to Solution.
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 ()
)
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.
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 ()
)
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |