The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Solved! Go to Solution.
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 ,
try this.
Cumulative Trx =
CALCULATE(
[Trxcount],
FILTER(
ALLSELECTED('Item'[Item]),
ISONORAFTER('Item'[Item], MAX('Item'[Item]), DESC)
)
)
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
Hi @mwegener
While using MAX function , i get the error ...max function can work only on numbers or dates and not string data types
I am using Connect Live (SSAS Tabular)
just for trying....I checked on pbix file where import method was used ...it works there...
Any idea ..why is it so??
Any suggestions on how to implement in connect live?
Hi @GuestUser ,
I am currently not working with SSAS Tabular, but it is documented in the DAX Guide as follows.
Returns the largest value in a column, or the larger value between two scalar expressions. Ignores logical values. Strings are compared according to alphabetical order.
Which version are you using?
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
Hi @GuestUser ,
the same problem is described here.
https://community.powerbi.com/t5/Service/Running-Total-Issue/td-p/964702
Unfortunately, the SELECTEDVALUE solution is only available from SSAS 2017.
https://dax.guide/selectedvalue/
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
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.
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?
Hi @GuestUser,
can you provide a screenshot?
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
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
Hi @GuestUser ,
can you post the DAX formula for both measures?
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
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)
Hi @mwegener ,
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)
Hi @GuestUser ,
I don't understand why the "cumulative count" for some items in screenshot is 0.
Here I would expect the value of the previous item.
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
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
Hi @GuestUser
I have created the following sample PBIX.
Why are these rows in your screenshot 0?
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
Hi @GuestUser
Try this pattern.
Cumulative Quantity :=
CALCULATE (
SUM ( Transactions[Quantity] ),
FILTER (
ALL ( 'Date'[Date] ),
'Date'[Date] <= MAX ( 'Date'[Date] )
)
)
Read this article for more info
https://www.daxpatterns.com/cumulative-total/
Hi @Mariusz
have tried this and its giving same value for all items same like transaction count
need the cumulative value item wise
any suggestion pls
Hi @GuestUser ,
You need to group by Year with ALLEXCEPT() function.
Refer to the following DAX:
Measure =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Year] ),
'Table'[Value] <= MAX ( 'Table'[Value] )
)
)
Here is the result.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
55 | |
21 | |
12 | |
11 | |
9 |
User | Count |
---|---|
109 | |
38 | |
28 | |
22 | |
22 |