Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
nicolast29
Helper V
Helper V

var multiple value

Hi

How to use a var with multiple values ?

 

Example:

CA DPH =
Var Section = 6 or 7,8,9
Return
CALCULATE(SUM(CAHebdo[CA]),CAHebdo[SectionAbaco]=Section)
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @nicolast29 ;

Do you mean that dynamic changes based on slicer changes? If yes, you can try:

Measure = 
CALCULATE(SUM('Table 2'[Value]),FILTER('Table 2',[Value] in  VALUES('Table'[Value])))

The final show:

vyalanwumsft_0-1669194115562.png

If not, can you share a simple data and result what you want to output?


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @nicolast29 ;

Do you mean that dynamic changes based on slicer changes? If yes, you can try:

Measure = 
CALCULATE(SUM('Table 2'[Value]),FILTER('Table 2',[Value] in  VALUES('Table'[Value])))

The final show:

vyalanwumsft_0-1669194115562.png

If not, can you share a simple data and result what you want to output?


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Jayee
Responsive Resident
Responsive Resident

Hi @nicolast29 ,

 

Try below measure

 

CALCULATE(SUM(CAHebdo[CA]),CAHebdo[SectionAbaco] in {6,7,8,9})

 

If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!

Hi

This was how i did it in the past, but i wanted to improve with variable

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors