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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
rem_time
Frequent Visitor

Help with slicer and measures with DAX (maybe)

Hi All

 

I hope you can help me with my problem. I'm still relatively new to Power BI even if I've been lurking here for a while so please bear with me.

 

Context:

My model have a table that contains Department and Location columns and another survey results table that is joined by location.

 

The department column contains two departments (Farming and Processing) while my location column have (Cashew Farming, Hazelnuts Farming, Hazelnut Processing, Cashew Processing, Pistachio, Processing etc.).

 

I am using calculated measures from survey results to give me a percentage figures that I show in a table (for example the one below). I am also using a slicer that uses the departments (Farming and Processing). 

 

Problem:

What I am trying to do now is if I select any department from the slicer (Farming for example), I would like the values to show only the ones for Cashew Farming, Hazelnut Farming, Pistachio Farming and if I change the selection to Processing, it will only show values for Cashew Processing, Hazelnut Processing, Pistachio Processing. 

 

Location   Great      Good      Bad   
Cashew   xxx   xxx   xxx
Hazelnut            xxx   xxx   xxx
Pistachio   xxx   xxx   xxx

 

I hope that makes sense? I have a feeling that this is a DAX solution but I'm not sure where to start.

 

Appreciate your help in advance! 

 

Thank you.

1 ACCEPTED SOLUTION

Hi Christoph

 

All good. I found out that it was a very simple fix - I just had to add another "Actual Location" column in my locations table. So that fixed up my slices and now it's showing the correct figures when they switch department selections. 🙂

 

Department Location Actual Location
FarmingCashew FarmingCashew
FarmingHazelnut FarmingHazelnut
FarmingPistachio FarmingPistachio 
ProcessingCashew ProcessingCashew
ProcessingHazelnut ProcessingHazelnut
ProcessingPistachio ProcessingPistachio

 

Thanks for helping out tho!

View solution in original post

6 REPLIES 6
ChrisMuthmann
Resolver II
Resolver II

I'm sorry, but I just have no idea what could be wrong.
Maybe you could post the definition of the calculated measures or a screenshot of your Power BI Desktop Model view?

Hi Christoph

 

All good. I found out that it was a very simple fix - I just had to add another "Actual Location" column in my locations table. So that fixed up my slices and now it's showing the correct figures when they switch department selections. 🙂

 

Department Location Actual Location
FarmingCashew FarmingCashew
FarmingHazelnut FarmingHazelnut
FarmingPistachio FarmingPistachio 
ProcessingCashew ProcessingCashew
ProcessingHazelnut ProcessingHazelnut
ProcessingPistachio ProcessingPistachio

 

Thanks for helping out tho!

ChrisMuthmann
Resolver II
Resolver II

Do you have a relationship from your fact table (survey) to the junk dimension (locations)?

Yes, there's a relationship between the two tables.

ChrisMuthmann
Resolver II
Resolver II

Hi!
If you have different tables and want to filter one by the other, you have to create a relationship in the tabular model first.

From your explanation I believe you have three tables, one fact (survey) and two dimensions (department, lodation). So you have to create a relationship between the fact and the dimension tables. Typically you will have a department_id and location_id in the fact table as a foreign key column.

HTH!

Kind regards,

Christoph

Hi Christoph

 

Thanks for taking the time to reply to me thread.

 

Just to clarify, I only have two tables in my model - one for survey results and another one named locations that have two columns (department and location). The third is a "visualisation table" but I used different cards and arranged them to look like a table. 

 

I guess what i'm trying to do here is if the selection in the Department slicer changes, the figures in the "visualisation table" will only show the figures related to that department.

 

For example, if they choose Farming as department, the figures for Cashew Farming, Hazelnut Farming and  Pistachio Farming will show in the "visualisation table". And when they choose Processing as department, the results related to Cashew Processing, Hazelnut Processing and Pistachio Processing will apply.

 

I hope that makes it clearer?

 

I guess my issue here is that
 

 

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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