The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi
I have a revenue which has two dates: dateExib and dateFact I want to sum(revenue) only if dateFact is different from dateExib. Do you know how can I do it?
Solved! Go to Solution.
Hi @Anonymous ,
Assume we have a table like below:
Then we can use the following DAX query:
revenuesum = CALCULATE(SUM(Table1[revenue]),FILTER(ALL(Table1),Table1[dateExib] <> Table1[dateFact]))
Best Regards,
Teige
The logic for "only if dateFact is different from dateExib" is:
IF('Table'[dateFact] <> 'Table'[dateExib], "Do something if true", "Do something if false")
But the second and third arguements depend on where you are putting the logic. Is this going to be a column in a table? Or will it be a measure?
Another way to ask this question is when you say "sum(revenue)" what revenue(s) do you mean?
Hi, try to create e measure
revenue = calculate(sum(revenue);dateFact <> dateExib)
Regards.
That sintaxe is not possible..-it was the first thing that I did by the way. Anyway I already solve that.
Hi @Anonymous ,
Assume we have a table like below:
Then we can use the following DAX query:
revenuesum = CALCULATE(SUM(Table1[revenue]),FILTER(ALL(Table1),Table1[dateExib] <> Table1[dateFact]))
Best Regards,
Teige
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
101 | |
82 | |
62 | |
56 |
User | Count |
---|---|
254 | |
119 | |
115 | |
100 | |
76 |