Forum Discussion
Cumulative dax query help
Hi mwegener
@Thanks for your inputs!!
Used below formula(similar)..replaced selected value by hasonevalue and it worked..
Thanks !!
Measure =
CALCULATE (
[Sales],
FILTER (
ALLSELECTED ( 'Table'[Category] ),
'Table'[Category] <= SELECTEDVALUE ( 'Table'[Category] )
)
)
Hi GuestUser ,
I am glad that your problem has been resolved, you could accept your own reply to close the case.
- GuestUser6 years agoHelper V
hi,
facing some strange behaviour
the below formula works
Cumulative = calculate( table[total sales],
filter
(allselected(item[item_name]),
item[item_name]<=if(hasonevalue(item[item_name]),values(item[item_name])
))
when i dont put any filter condition on total sales..cumulative value is correct...but it shows item with no sales as well
So when i put filter condition as total sales is not blank in report ,
then the cumulative value shows wrong value..it shows correct for 2 records..then the third record..it shows the same value as total sales
Any suggestions pls?
- GuestUser6 years agoHelper V
- GuestUser6 years agoHelper V
Hi mwegener
First screenshot is without any filter condition added -- it giving correct result
Second one - Added filter condition on filter pane ..like trx count is not blank...it gives incorrect result
basically i do not need those items in the report with trx count blank
Any suggestions pls
- GuestUser6 years agoHelper V
Hi,
1) Cumulative = calculate( table[trx count],
filter
(allselected(item[item_name]),
item[item_name]<=if(hasonevalue(item[item_name]),values(item[item_name])
))
2) Trx Count = sum(table.item_count)
- GuestUser6 years agoHelper V
Hi mwegener ,
Thanks for your inputs!!
Changed formula for Trx Count
Trx_Count = if(sum(Table[Item_count]) = blank(),0,sum(table[item_count])) ---- Shows 0 instead of blank
And Cumulative values show..previous value where Trx_Count is 0
But still I am not able to get rid of records having Trx_Count=0 , when i apply filter..it gives incoorect cumulative value...as posted in previous screenshot