Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Dear Friends
I have table: hotelid, date & amount and need to calculate run Total amount :
And need to get result in this format:
When no slicer output will be:
But I am getting correct result when I slice hotel id but when I don’t slice hotelId getting wrong data on 4/6 December
112 selected:
113 selected:
I created the measures:
runTotal = CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[date]<=MAX('Table'[date]))
,VALUES('Table'[hotelid])
)
Could you please anyone help me
Solved! Go to Solution.
Hi,
thank you for your message.
Please try the below, or if it does not suit your requirement, please share your sample pbix file.
runTotal by date =
CALCULATE (
SUM ( 'Table'[amount] ),
FILTER ( ALL ( 'Calendar' ), 'Calendar'[date] <= MAX ( 'Calendar'[date] ) )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
Thank you for your feedback.
I am not sure but please also try the below after assigning the calendar table as Date table.
If it does not provide the correct answer, then please share your sample pbix file, and then I can try to look into it to come up with a more accurate solution.
runTotal by date =
CALCULATE (
SUM ( 'Table'[amount] ),
FILTER ( ALL ( 'Calendar'[date] ), 'Calendar'[date] <= MAX ( 'Calendar'[date] ) )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
Create a Calendar Table and then create a relationship (Many to One and Single) from the Date column of your Table to the Date column of the Calendar Table. Create your slicer from the Date column of the Calendar Table. To your visual, drg Date from the Calendar Table. Write these measures:
Total = sum(Table[Amount])
Running total = calculate([Total],datesbetween(Calendar[Date],minx(allselected(Calendar[Date]),calendar[Date]),max(calendar[date])))
Hope this helps.
Hi,
Please check the below picture and the attached pbix file if it suits your requirement.
runTotal =
CALCULATE ( SUM ( 'Table'[amount] ), 'Table'[date] <= MAX ( 'Table'[date] ) )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
give wrong info when i slice hote id
runTotal by date =
CALCULATE (
SUM ( 'Table'[amount] ),
FILTER ( ALL ( 'Table'[date] ), 'Table'[date] <= MAX ( 'Table'[date] ) )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
It's work fine, but table is related with Dates table and I have slicer from Dates table . How can I apply Dates(date) to above dax
Hi,
thank you for your message.
Please try the below, or if it does not suit your requirement, please share your sample pbix file.
runTotal by date =
CALCULATE (
SUM ( 'Table'[amount] ),
FILTER ( ALL ( 'Calendar' ), 'Calendar'[date] <= MAX ( 'Calendar'[date] ) )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Thanks, its giving the correct information but its taking more time than usual.
Hi,
Thank you for your feedback.
I am not sure but please also try the below after assigning the calendar table as Date table.
If it does not provide the correct answer, then please share your sample pbix file, and then I can try to look into it to come up with a more accurate solution.
runTotal by date =
CALCULATE (
SUM ( 'Table'[amount] ),
FILTER ( ALL ( 'Calendar'[date] ), 'Calendar'[date] <= MAX ( 'Calendar'[date] ) )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
User | Count |
---|---|
128 | |
108 | |
100 | |
65 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |