Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
I have a table with data on purchases and their entries in my model (see picture.)
I need to calculate the sum of purchase values for all suppliers that have at least one entry on the year of purchase without filtering only unit entries. I need some help creating the measure for it.
The sample Pbix is on the link:
https://drive.google.com/file/d/1UtRE4MuIrKg0iwp1GlsxPp8UYvvIHJkL/view?usp=sharing
Thanks a lot, Rita
Solved! Go to Solution.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi,
Thank you for your response, but this is not what I need.
your dax is calculating all purchases, I need all purchases of suppliers that have at least 1 entry on the filtered period...
Mindik doesn't have entries in 2021 so I need to get 0 for him
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Wow!! Thank you, exactly what I need 🙂
Hi @Ritaf ,
Do you have sample output? If I understood correctly, you want to only show amounts where the entry date and purchase dates are within the same year?
If so, this is likely what you're looking for:
Sum of Purchases Same Year = CALCULATE(SUM(purchaseItems[purchaseValue]), YEAR(purchaseItems[entryDate]) = YEAR(purchaseItems[puchaseCretedon]))
HI,
Thank you for your response.
This formula is not exactly what I need because it will summarize only rows with entries.
I need to take all suppliers who have at least one entry and summarize all their purchases including the items that didn't incomed.
In the picture below the result, I want for Magnafy is 230.
@Ritaf ,
Can you tell me the logic on how you're omitting item ID 555 and 666? Or how you're including 222? Why is it only 2021 and not 2022?
555 was with a mistake which I
corrected.
666 is correct...entry date is 08/12/2022 (8 December)
Hi @Ritaf,
Changing the date for purchase id 555 by 8 days doesn't really help me understand the exclusion logic. Days for 555 and 666 seems to be future dates. Do you want to omit future purchase dates?
No, I want to calculate for Supplier all values by year, but I want to do it for only those who have at least one entry in the year of calculating...
Hi @Ritaf ,
Is this safe to assume so?
NO , i don't need notes
i need a calculation...
hehehe,
those notes are for me to understand where to add the numbers to. Can you confirm my understanding?
OK, and yes that's the logic
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
72 | |
38 | |
31 | |
27 |
User | Count |
---|---|
92 | |
50 | |
44 | |
40 | |
35 |