cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
ppriya
Frequent Visitor

Filter to be automated on the basis of selection in the field

Hi all,

 

Need to automate the Filter section in DAX on the basis of selection in a particular field.

You need to make the selection in Testaname field.

Below is the data Set

 

IDEmployee IDEmployee NameEmployee Status
1E1ABCActive
2E2CEFActive
3E3GHIActive
4E4JKLInactive
5 MNOActive
6E6PQRActive
7E7 Active
8E8VWActive
9E9XY 
10E10ZActive

 

RowID TestaNameTable NameField
1Employee ID is BlankTest DataEmployee ID
2Employee Name is BlankTest DataEmployee Name
3Employee Status is BlankTest DataEmployee Status

 

When i do any selection in TestaName field it should return me the count of blank of that particulate column in the 1st table 

 

Dax which i created and is not working

Project_Measure_testing =
VAR vTablename = SELECTEDVALUE(FA_DATA_MATURITY[TABLE_NAME])

VAR vFieldname = "Filter('"&SELECTEDVALUE(FA_DATA_MATURITY[TABLE_NAME])&"',isblank('"&SELECTEDVALUE(FA_DATA_MATURITY[TABLE_NAME])&"'["&SELECTEDVALUE(FA_DATA_MATURITY[FIELD_NAME])&"]))"

Return --Query
Calculate(count(LU_PROJECT[PROJECT_ID]),vFieldname)
 
Kindly help me with this.
 
Thanks !
5 REPLIES 5
v-yadongf-msft
Community Support
Community Support

Hi @ppriya ,

 

Field parameters are recomended.

 

Please create three measures:

Employee ID is Blank = CALCULATE(COUNT('Table'[Employee ID]),FILTER('Table','Table'[Employee ID] = BLANK()))

Employee Name is Blank = CALCULATE(COUNT('Table'[Employee Name]),FILTER('Table','Table'[Employee Name] = BLANK()))

Employee Status is Blank = CALCULATE(COUNT('Table'[Employee Status]),FILTER('Table','Table'[Employee Status] = BLANK()))

 

Modeling - New parameter - Fields

vyadongfmsft_0-1665456226130.png

 Add fields:

vyadongfmsft_1-1665456260813.png

Create a slicer:

vyadongfmsft_2-1665456338991.png

 

Create a card visual:

vyadongfmsft_3-1665456390271.png

 

You will get the count of blank of that particulate column in the 1st table :

vyadongfmsft_4-1665456449349.png

 

Best regards,

Yadong Fang

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

 
Actually i am looking out for a solution where in i need not create multiple DAX.just on the basis of selection the tablename and fieldname changes and i get the output.
Any Suggestion
 
 
 
 
 
 
 
 
 
 
 

Hi @ppriya 

 

Did I solve your problem? If solved, please consider Accept it as the solution to help the other members find it more quickly.

 

Best regards,

Yadong Fang

ppriya
Frequent Visitor

Kindly help with the issue .

ppriya
Frequent Visitor

Correct Dax
 
Project_Measure_testing =
VAR vTablename = SELECTEDVALUE('Mapping table'[Table Name])

 

VAR vFieldname = "Filter('"&SELECTEDVALUE('Mapping table'[Table Name])&"',isblank('"&SELECTEDVALUE('Mapping table'[Table Name])&"'["&SELECTEDVALUE('Mapping table'[Field])&"]))"



Return vFieldname
--Calculate(count('Test Data'[ID]),vFieldname)

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors