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
mda
Advocate I
Advocate I

Show values from different rows in one row based on two slicers selection

I have a Table with those columns: Country, Year, Value.

 

I also have two slicers - on each of them I can select only one year.
Both of this slicers are using Year columns from two different tables Years1, Years2 created as:

SUMMARIZE(Table; Table[Year]).

 

Now I want to show a table with those values:

Country, Value for year from the first slicer, Value for year from the second slicer

 

I can read slicer selected value, but it can be accessed only in a measure like this:

 

Selected Yea 1r = IF (
   ISFILTERED ( Year1[Year] ) && HASONEVALUE (Year1[Year] );
   LASTNONBLANK ( Year1[Year]; 0 );
   2017
)

 

The problem is that I can't use in any table join or filter

 

So I don't know how to do solve this problem.

 

Can anyone help?

 

Thanks,

Marcin

1 ACCEPTED SOLUTION

Yes, I figured it out.
Instead of that, I self-joined that table and after that, I had all combinations and now filtering is possible.

 

Marcin

View solution in original post

2 REPLIES 2
v-sihou-msft
Employee
Employee

@mda

 

In Power BI Desktop, the calculated table is evaluated before you take selection in slicer. So you can dynamically show the values via measure based on the selection in slicer. And since you don't have relationships between the source table and those two year tables your measure will always show the last non blank value in year table. 

 

Regards,

Yes, I figured it out.
Instead of that, I self-joined that table and after that, I had all combinations and now filtering is possible.

 

Marcin

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.