cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Dynamic Meassure Selection

Hello,

 

I have created a meassure (below) ,

Total Sales by Dept = IF (ISCROSSFILTERED(DynamicSelection[Selection]) ,
SWITCH(TRUE(),
VALUES(DynamicSelection[Selection]) = "Finance" , 'TableDept'[Total Cost(USD)],
VALUES(DynamicSelection[Selection]) = "Account" , 'TableDept'[Total Cost (EUR)],
VALUES(DynamicSelection[Selection]) = "Operations" , 'TableDept'[Total Cost (Fr)],
BLANK()))
 

Above meassure allows users to dynamically select the department from the slicer and then all the visual only presents the data based on user selection. It works great, but as soon user selects other values from other slicers (example Year, Manager, etc.) in the report, values of measure above does not change.

 

Assuming other slicer is Employee[Manager].

 

Do I need to add something to above meeasure to make it work?

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Actually, it was a data issue. My orignal DAX formula worked just fine. Thanks for teh help @TomMartens

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

 

give this a try:

Total Sales by Dept = IF (ISCROSSFILTERED(DynamicSelection[Selection]) ,
SWITCH(TRUE(),
VALUES(DynamicSelection[Selection]) = "Finance" , CALCULATE(SUM('TableDept'[Total Cost(USD)])),
VALUES(DynamicSelection[Selection]) = "Account" , 'TableDept'[Total Cost (EUR)],
VALUES(DynamicSelection[Selection]) = "Operations" , 'TableDept'[Total Cost (Fr)],
BLANK()))

I just changed one column reference :-), put the CALCULATE(SUM(...)) around the remaining column references.

If this will not solve your issue, you might consider to prepare a pbix file with some sample data, upload the file to onedrive or dropbox and share the link.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Actually, it was a data issue. My orignal DAX formula worked just fine. Thanks for teh help @TomMartens

Helpful resources

Announcements
May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through June10th!

Power BI Dev Camp Session 22 without aka link and time 768x460.jpg

Check it Out!

Watch Session 22 Ted's Dev Camp along with past sessions!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!

Top Kudoed Authors