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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

SELECTEDMEASURE should filter the table

Hello.

I have 2 measures, [Trained] and [Not Trained] for each active employee in a selected year(from a slicer)

If I select the 4 on the left which stands for not trained, I want the table to show only the rows where [Is Trained] = 0
If I selected trained, the table should show the values where [Is Trained] = 1
However, that does not affect the table at all. I want the table to be dynamically filtered based on my slicer selection.

I tried functions such as SELECTEDMEASURE( ), SELECTEDMEASURENAME( ), ISSELECTEDMEASURE( ),
SELECTEDMEASUREFORMATSTRING( ) but neither of those worked.
Dritan_0-1663935023821.png

I added this other measure in order to filter for TRUE values but it didn't work.

Dritan_2-1663935373119.png


I would appretiate your help/suggestions.

Thank you.

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

I have created a simple sample, please refer to it to see if it helps you.

Create a measure.

Measure =
VAR _selected =
    SELECTEDVALUE ( 'Table'[YES OR NO] )
RETURN
    IF ( _selected = "Not Trained", 0, IF ( _selected = "Trained", [is trained] ) )

vpollymsft_0-1664174865197.png

If I have misunderstood your meaning, please provide your pbix file without privacy inforamtion .

 

Best Regards

Community Support Team _ Polly

 

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

 

Anonymous
Not applicable

This is not the exact scenario.

I am sharing a sample file to illustrate my problem and hopefully resolve it with your help.

I want to filter active employees based on my YEAR selection from a slicer. YEAR is a field on my date table named DATA TAB.
Active employes should have started working before or on the year selected, and termination date should either be on the year selected or after that year, or blank if the employee is still working.

After I manage to consider only active employees I thought to create a measure with trained employees in a selected year. I named the measure [Trained]
Not trained is the difference from total employees to [trained] employees.

I want the pie chart that shows distinct employees trained, and those not trained in a selected year, to filter the table as well.

Suppose I want to see not trained employees and I want this to be filtered in the table from my pie chart selection.
I hope I was clear.
https://we.tl/t-D5ZK2kS3Rg 
Here is the file vie wetransfer.

Thank you

amitchandak
Super User
Super User

@Anonymous , use calculation group for that

https://www.sqlbi.com/blog/marco/2020/07/15/creating-calculation-groups-in-power-bi-desktop/

 

Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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