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
Anonymous
Not applicable

slice selection determine visualization

aHi all,

I have a question and am wondering how you implement this in PBI.

For example, I have a slicer below consists of all the states in Australia and the slicer only allows one selection a time.

J1.JPG

Hence,  when a user select state "NSW", the visualisation will compute:

1) Spend incurred in NSW

2) Spend incurred in Non-NSW

J2.JPG

 

The following is my two query table models:

J3.JPG

Questions - 

The problem that I am facing is ... since the slicer is wither using 'Vendor'[State]  or 'Indigenenous Spend'[State], the moment when I select NSW in the slicer, how is my DAX going to implement the below two items below:

 

* To exclude NSW to compute the NON-NSW Spend?

* To include NSW to compute the NSW spend?

 

The problem is I cannot manually assign the value like below as user can select any state anytime. Hence the following two are not possible:

* TargetStateSpend =Calculate(SUM('Indigeneous Spend'[Spend Amount]), filter(''Indigeneous Spend', ''Indigeneous Spend'[State]="NSW"))  

 

* NonTargetStateSpend = Calculate(SUM('Indigeneous Spend'[Spend Amount]), filter(''Indigeneous Spend', ''Indigeneous Spend'[State] <> "NSW"))  

 

How to pass the value in the slicer into the above two measurements as variable? 

 

Thanks.

Tuff

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can create measures like DAX below.

 

* TargetStateSpend =Calculate(SUM('Indigeneous Spend'[Spend Amount]), ALLSELECTED(''Indigeneous Spend'[State]))  
 
* NonTargetStateSpend = Calculate(SUM('Indigeneous Spend'[Spend Amount]), EXCEPT ( ALL ( 'Indigeneous Spend'[State] ), ALLSELECTED ( 'Indigeneous Spend'[State])))  

 

Best Regards,

Amy

 

Community Support Team _ Amy

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

1 REPLY 1
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can create measures like DAX below.

 

* TargetStateSpend =Calculate(SUM('Indigeneous Spend'[Spend Amount]), ALLSELECTED(''Indigeneous Spend'[State]))  
 
* NonTargetStateSpend = Calculate(SUM('Indigeneous Spend'[Spend Amount]), EXCEPT ( ALL ( 'Indigeneous Spend'[State] ), ALLSELECTED ( 'Indigeneous Spend'[State])))  

 

Best Regards,

Amy

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.