Right now Im stuck with an issue, we have a slicer with a "selected all" function, but my measure calculation wont work with it and shows either blank or a random value.
With the first part of the code, we secure that the user of the report select a year, but we also want to be able to select all groups with one click, but since that doesnt work in DAX, we have decided to try another solution.So if nothing is selected in the group slicer, the calculation should show a total of all groups.
Try modify the measure as below and check if it works:
Selected year = IF ( AND ( HASONEVALUE ( NavOmsGrupper[gruppe] ); HASONEVALUE ( 'Calendar'[Year] ) ); CALCULATE ( SUM ( FinansTransaktioner[Belob] ) ); IF ( ISFILTERED ( 'Calendar'[Year] ); CALCULATE ( SUM ( FinansTransaktioner[Belob] ); FILTER ( ResourceGrupper; ResourceGrupper[Resource Gruppe (groups)] ) ); "select a year" ) )
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I modified it a little, I get a result, but it dosnt make sence, so if you have any solution it would be great.
Could you please share some sample data and clairfy more details about your requirement?
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Not really enough information in your post to tell what is happening.
Learn how to create your own user groups today!
Click here to read more about the November 2021 Updates!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.