Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello there,
First of all, excuse me and my low skills on DAX.
I have this "Earnings" column, and I need a Line chart where it shows an Accumulative version during time with the legend of the shop_id.
This table is on DirectQuery mode, but I think this Accumulative measure can be done in the Desktop page.
FYI: The chart will be showing real-time data and only for the current day (I don't know if this info is helpful and important for the measure, sorry).
SHOP_ID | EARNINGS | TIME |
1 | $45.60 | 16:50 |
2 | $980,654.88 | 11:20 |
3 | $324.01 | 13:30 |
4 | $1 | 09:10 |
5 | $54.78 | 22:20 |
Any help or advice would be kindly appreciated.
Thank you!
Solved! Go to Solution.
@Anonymous , Ideal is datetime column and cumulative like
sumx(filter(allselected(Table), Table[Datetime] <= Max(Table[Datetime])), Table[Earning])
or
sumx(filter(allselected(Table), Table[Datetime] <= Max(Table[Datetime]) && Table[ID] = max(Table[ID]) ) , Table[Earning])
@Anonymous , Ideal is datetime column and cumulative like
sumx(filter(allselected(Table), Table[Datetime] <= Max(Table[Datetime])), Table[Earning])
or
sumx(filter(allselected(Table), Table[Datetime] <= Max(Table[Datetime]) && Table[ID] = max(Table[ID]) ) , Table[Earning])
When using the second design, the one with IDs, I get the chart above. And when I use the first one, I get the chart below with the value accumulating in all the shops at the same time.
I think I must add that each shop_id will appear more than once in the table, because you can buy something in one shop several times on several days.
What I'm trying to draw is one continuous accumulative line for each shop during that time period.
Sorry for all this bothering, and thank you for your time and patience!
Hi @Anonymous ,
I agree with amitchandak 's second code. I have a test by amitchandak 's code, and it will work in my sample.
Could you share more details about your data model or share a sample file created by import mode with us? This will make it easier for us to find the solution.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
117 | |
75 | |
62 | |
50 | |
44 |
User | Count |
---|---|
174 | |
125 | |
60 | |
60 | |
57 |