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.
Hello!
I'm trying to create a conditional sum of sales such as:
I have sales data for Company A, B, C and D for the whole 2021 year. However, I have in another table dates from which I should be calculating the Sales such as:
Company A: calculate only after 10.02.2021
Company B: calculate only after 15.06.2021
Company C: calculate only after 17.08.2021
Company 😧 calculate only after 02.10.2021
This table is connected to the Sales tables with Company names, Dates and number of sales
And is connected to the Date table (also connected to sales tables).
How can I create a Sum measure, to ingnore for each companies the Sales before the related dates?
I'm sure the solution is simple, but I can't wrap my head around it!
Thank you so much for your help.
Best,
BT.
Solved! Go to Solution.
Consider this solution
create a company table with
company id, company name, afterdate
create a sales table with
date, company id, value
create a 1:m relationship from company[companyid] to sales[companyid]
create measure
Consider this solution
create a company table with
company id, company name, afterdate
create a sales table with
date, company id, value
create a 1:m relationship from company[companyid] to sales[companyid]
create measure
However, when I put Company and this measure next to normal sum, it will show me another value as expexted for a company where we count after the date; but the sum of those two will be the same.
How can we include "sum only after this date" if we look at the total of the measure with a slicer that selects all the companies ?
I don't know if it is clear?
Works perfectly! thank you 🙂
@ING_BT This may help. Specifically SUMIF
S Excel to DAX Translation - Microsoft Power BI Community
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 |
---|---|
111 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |