The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Below is the measure(v_Cum. Est Umsatz BK), on which for which I wanted to calculate cumulative values(Year to date). But instead it's giving me total sum for the year.
Hi,
Thanks for the solution @Ritaf1983 provided, and i want to offer some more information for user to refer to.
hello @Varishtha , based on your description, you can consider to use a alternative solution, you can try the following measure.
v_Cum. Est Umsatz BK =
IF (
[v_Est Umsatz BK] <> BLANK (),
CALCULATE (
[v_Est Umsatz BK],
ALLSELECTED ( 'Calendar'[Dates] ),
YEAR ( 'Calendar'[Dates] ) = YEAR ( MAX ( 'Calendar'[Dates] ) ),
'Calendar'[Dates] <= MAX ( 'Calendar'[Dates] )
)
)
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,/\
I tried using the measure, but as you can see in the ss below, I am still getting total value, instead of cumulative values.
Hi @Varishtha
Yes if you use all() functions on your fact table / dim date table it removes all filters, so the result cannot be filtered by date...
This is the reason for having all the sum for every date...
If this post helps, please consider Accepting it as the solution to help the other members find it more quickly.
Hello @Ritaf1983 ,
But did you check my measues, I have used all() in the measure - v_% prev_year_contribution BK , but this measure was also used with the measure "v_Est Umsatz BK" and gave expected results.
Then why is the "v_Cum. Est Umsatz BK" causing isuues.
P.S., all mentioned measures have been defined in my OG post.
Hi @Varishtha
You can use TOTALYTD function, please refer to the linked tutorial :
https://www.youtube.com/watch?v=0yHOiGXoi9w
For more detailed suggestion
Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test the coding formula.
How to Get Your Question Answered Quickly
If this post helps, please consider Accepting it as the solution to help the other members find it more quickly.
Hey @Ritaf1983 ,
It's difficult, but I will try to arrange sample data. Meanwhile I tried TotalYTD and it failed.
TotalYTD is also giving total sum of the year for each month.
Is it possible that, because in the measures I am using ALL() function.
Pls see the snap below: