Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi PBIX community,
I'm looking to show cummulative count in a table. The cummulative count works fine until 11PM but then it kind of goes awry. I have date and hour table as dimentions. Date and hour table are related to data table via inactive relationships. I have used 'userelationship' functions in my DAX to count instances by hour.
Attached is PBIX file and results that I'm expecting in an excel file.
* How do I navigate to resolve the cummulative total issue?
* Why is there a value of '8' in cumulative column on 13 July 2021?
* How can I get rid of cummulative data for 14 July 2021?
DAX for cummulative is:
Any hints or tips to resolve this error would be helpful. Thanks a lot in advance!
https://www.dropbox.com/sh/l94j7rb9iavm783/AADqJs6dOZU06anbmdfftyiUa?dl=0
Solved! Go to Solution.
@sam0007 ,
I'm not sure this is the best implementation since I'm not aware about your real model and all the prerequisites, but you can try this option:
Cummulative Eq Assign_2 =
VAR currentDate = MAX ( d_DateTable[Date] )
VAR currentTime = MAX ( d_HourTable[Hour of Day] )
VAR prevDayValue =
IF (
ISINSCOPE ( d_DateTable[Date] ),
CALCULATE (
[EqAssignPerHour],
FILTER ( ALL ( d_DateTable[Date] ), d_DateTable[Date] < currentDate ),
ALL ( d_HourTable[Hour of Day] )
)
)
VAR c_amt =
CALCULATE (
[EqAssignPerHour],
FILTER (
ALL ( d_HourTable[Hour of Day] ),
d_HourTable[Hour of Day] <= currentTime
)
)
RETURN
IF ( NOT ISBLANK ( [EqAssignPerHour] ), prevDayValue + c_amt )
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
That worked! Thank you!
Sorry, have a small issue here, on Tuesday 13 Jul 2021 cummulative column shows as 11 it should be 41 because:
Cummulative count 30 on Monday 12 Jul 2021 @ 11 PM
+
11 new equipment on Tuesday 13 Jul @ 1 AM.
resulting in 41 for cummulative column at 1AM.
Thanks!
@sam0007 ,
I'm not sure this is the best implementation since I'm not aware about your real model and all the prerequisites, but you can try this option:
Cummulative Eq Assign_2 =
VAR currentDate = MAX ( d_DateTable[Date] )
VAR currentTime = MAX ( d_HourTable[Hour of Day] )
VAR prevDayValue =
IF (
ISINSCOPE ( d_DateTable[Date] ),
CALCULATE (
[EqAssignPerHour],
FILTER ( ALL ( d_DateTable[Date] ), d_DateTable[Date] < currentDate ),
ALL ( d_HourTable[Hour of Day] )
)
)
VAR c_amt =
CALCULATE (
[EqAssignPerHour],
FILTER (
ALL ( d_HourTable[Hour of Day] ),
d_HourTable[Hour of Day] <= currentTime
)
)
RETURN
IF ( NOT ISBLANK ( [EqAssignPerHour] ), prevDayValue + c_amt )
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Hi @sam0007 ,
I didn't check the figures for other measures (as far as I've understood, you only have issues with cummulative measure) and according to your visual you can change the measure this way:
Cummulative Eq Assign_2 =
VAR currentDate = MAX ( d_DateTable[Date] )
VAR currentTime = MAX ( d_HourTable[Hour of Day] )
VAR result =
CALCULATE (
[EqAssignPerHour],
FILTER (
ALLSELECTED ( d_DateTable[Date] ),
d_DateTable[Date] <= currentDate
),
FILTER (
ALLSELECTED ( d_HourTable[Hour of Day] ),
d_HourTable[Hour of Day] <= currentTime
)
)
RETURN
IF ( NOT ISBLANK ( [EqAssignPerHour] ), result )
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
User | Count |
---|---|
16 | |
15 | |
14 | |
12 | |
11 |
User | Count |
---|---|
19 | |
16 | |
14 | |
11 | |
9 |