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,
It is related to a question I previously asked.
https://community.powerbi.com/t5/Desktop/Difference-from-previous-cell/m-p/1091974
I am unable to solve the following problems.
I am counting the difference of the counts the day before (DAX_diff2).
However, the number of counts is sometimes revised and may be negative compared to the previous day.
Then I can't calculate well.
In the example below, the calculation is not "difference between a certain day and the day before that day" but "difference between a certain day and the maximum value up to the previous day".
I want to set the value of "max_test1" to "249,619" when the value of "Dax_Last_date" is 5/20.
The formula I'm using is:
DAX_Last date = maxx(filter('Table',[Country/Region]=earlier([Country/Region]) && [YYYYMMDD] <earlier([YYYYMMDD])),[YYYYMMDD])
DAX_diff2(case_a_day) = [count_cum] - maxx(filter('Table',[Country/Region]=earlier([Country/Region]) && [DAX_Last date] <earlier([DAX_Last date])),[count_cum])
maxx_test1 = maxx(filter('Table',[Country/Region]=earlier([Country/Region]) && [DAX_Last date] <earlier([DAX_Last date])),[count_cum])
Solved! Go to Solution.
Hi @owlet0214
your max_test returns the MAX value for all previous period.
you need smth like
maxx_test1 =
var _maxDate = maxx(filter('Table',[Country/Region]=earlier([Country/Region]) && [DAX_Last date] <earlier([DAX_Last date])),[DAX_Last date])
RETURN
maxx(filter('Table',[Country/Region]=earlier([Country/Region]) && [DAX_Last date] = _maxDate),[count_cum])
Hi @owlet0214
your max_test returns the MAX value for all previous period.
you need smth like
maxx_test1 =
var _maxDate = maxx(filter('Table',[Country/Region]=earlier([Country/Region]) && [DAX_Last date] <earlier([DAX_Last date])),[DAX_Last date])
RETURN
maxx(filter('Table',[Country/Region]=earlier([Country/Region]) && [DAX_Last date] = _maxDate),[count_cum])
Finally it worked!
Thank you!
Thank you very much.
I have a meeting so I will try it later.
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 |
---|---|
115 | |
100 | |
88 | |
69 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |