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.
Dear all,
I already spent too much time on this, so hope you can help. Seems like a pretty basic thing to do but I cannot.
I have 2 slicers: Region and Country. The combination of the 2 selections, can give me the Zone.
I can call out the zone via a measure:
Solved! Go to Solution.
Hi , @ChavdarG
Are you referring to an error like the following?
If so ,it is suggested to set a variable to store the value of the measure.
Please change you measure as below:
BP GSR 4 ZONE SELECTED =
VAR a = [ZONE SELECTION]
RETURN
CALCULATE ( SUM ( 'ALL CCs'[GSR BP] ), 'ALL CCs'[Zone] = a )
You can also use the filter function to encapsulate your filter expression:
BP GSR 4 ZONE SELECTED2 =
CALCULATE (
SUM ( 'ALL CCs'[GSR BP] ),
FILTER ( 'ALL CCs' , 'ALL CCs'[Zone] = [ZONE SELECTION] )
)
Best Regards,
Community Support Team _ Eason
Hi , @ChavdarG
Are you referring to an error like the following?
If so ,it is suggested to set a variable to store the value of the measure.
Please change you measure as below:
BP GSR 4 ZONE SELECTED =
VAR a = [ZONE SELECTION]
RETURN
CALCULATE ( SUM ( 'ALL CCs'[GSR BP] ), 'ALL CCs'[Zone] = a )
You can also use the filter function to encapsulate your filter expression:
BP GSR 4 ZONE SELECTED2 =
CALCULATE (
SUM ( 'ALL CCs'[GSR BP] ),
FILTER ( 'ALL CCs' , 'ALL CCs'[Zone] = [ZONE SELECTION] )
)
Best Regards,
Community Support Team _ Eason
Hello,
Yes, this is it. I knew I was missing something and it shouldn't be too complicated.
Thx a lot!
Try one of the following:
VAR varSelection =
LOOKUPVALUE(
'ALL CCs'[Zone],
'ALL CCs'[Country name], SELECTEDVALUE( 'ALL CCs'[Country name] ),
'ALL CCs'[Region], SELECTEDVALUE( 'ALL CCs'[Region] )
)
RETURN
CALCULATE(
SUM( 'ALL CCs'[GSR BP] ),
'ALL CCs'[Zone] = varSelection
)
That still uses a predicate, which may be the issue, not that CALCULATE cannot work with measures. If that fails, try this:
Final Measure =
VAR varSelection =
LOOKUPVALUE(
'ALL CCs'[Zone],
'ALL CCs'[Country name], SELECTEDVALUE( 'ALL CCs'[Country name] ),
'ALL CCs'[Region], SELECTEDVALUE( 'ALL CCs'[Region] )
)
RETURN
CALCULATE(
SUM( 'ALL CCs'[GSR BP] ),
FILTER(
ALL( 'ALL CCs'[Zone] ),
'ALL CCs'[Zone] = varSelection
)
)
It replaces the predicate with the underlying code using FILTER.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI Reporting@ChavdarG It will be easier if you share pbix file using one drive/google drive with the expected output. Remove any sensitive information before sharing.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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 |
---|---|
108 | |
105 | |
88 | |
74 | |
66 |
User | Count |
---|---|
126 | |
111 | |
100 | |
83 | |
71 |