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, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
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.

October NL Carousel

Fabric Community Update - October 2024

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

Top Solution Authors