Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Who can help me with the following problem?
The formula 'Result same period last year' gives correct values for the subtotal, but details are blank for those rows where the result for this year is blank.
DAX-formula:
Resultaat vorig jaar = CALCULATE(sum('FACT-GrootboekMutaties'[Bedrag])*-1,'DIM-Grootboek'[GrootboekType]="P",SAMEPERIODLASTYEAR('DIM-Kalender'[Date]))
For example:
When asking for the 'Result this year' while filtering last year, it shows the correct results.
Thanks for your help!
You should not include calculation in the expression (*-1), put it outside the calculate function like below.
Resultaat vorig jaar = CALCULATE(sum('FACT-GrootboekMutaties'[Bedrag]),'DIM-Grootboek'[GrootboekType]="P",SAMEPERIODLASTYEAR('DIM-Kalender'[Date]))*-1)
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
Instead of using 'DIM-Grootboek'[GrootboekType]="P" as an internal filter context , remove that and use as an external and see whehter it works! I am thinking the issue with Internal Filter context!
Proud to be a Super User!
@VijayP @Thanks for your help. I even removed the filter but it makes no difference.
I can't find out why the totals are shown correct, and individuals lines are empty, only when the result of this year is empty.
@haraldjw , Please make sure calendar table is marked as date table
also Try
Resultaat vorig jaar = CALCULATE(sum('FACT-GrootboekMutaties'[Bedrag])*-1,'DIM-Grootboek'[GrootboekType]="P",dateadd('DIM-Kalender'[Date],-1,year))
@amitchandak The calender is marked as date table (of course).
The strange thing is: Why are the subtotals correct? And those details missing where the value of this year is blank?
@haraldjw , very difficult to tell without looking at data.Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
@amitchandak I appreciate your help! Can you send me a PB where to send the file?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |