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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jimmyg706
Helper IV
Helper IV

Measures for Blank or Not Blank

Hi All

 

I want to create some quality check measures for a dataset and Im really struggling. Its to flag if there is data missing for must have fields/columns that need to be  filled in. I don’t want calculated Columns as I  don’t need any slicers for this this.

 

I have a list of applications  with 5x key Columns of Data – In yellow See Fig 1 below. 

 

There are say 5x Columns (Columns A-F)  that are critical pieces of data which simply must have data i.e must not be empty

 

So its either empty or not empty, but they should have text data in there.

 

So I was going to create 5x separate measures for Columns 1-5 below. Then add all the measures together to get a % complete.

 

So if its blank I output a ZERO and if its not empty I output a true value of 1.

 

The idea then is that I then have a % complete for the 5x columns.

 

However Im really struggliing to approach this in the right way and need some assistance.

 

Thanks In

 

Fig 1

 

jimmyg706_1-1710965300933.png

 

Datset Below

 

APPColumn 1Column 2Column 3Column 4Column 5
App 1DATA    
App 2DATADATA   
App 3DATADATADATA  
App 4DATADATADATADATA 
App 5DATADATADATADATADATA

 

Visuliation of Measures

 

APPColumn 1Column 2Column 3Column 4Column 5Measure Column 1Measure Column 2Measure Column 3Measure Column 4Measure Column 5Add Measures Together% Complete Measure
App 1DATA    10000120%
App 2DATADATA   11000240%
App 3DATADATADATA  11100360%
App 4DATADATADATADATA 1111 480%
App 5DATADATADATADATADATA111115100%

 

1 ACCEPTED SOLUTION
v-junyant-msft
Community Support
Community Support

Hi @jimmyg706 ,

You measures are right. But if you have a very large number of columns, you will need to create a very large number of measures to fulfill your needs, and this can become cumbersome. There's no way this can be done with just one measure either.
If you can use Power Query Editor, it may be easier but it will add six more columns in your table without any measures. This method is not much different in terms of memory consumption than if you were to create a lot of measures, but it can be much easier to work with.
First, in Power Query and choose all of these columns and replace values:

vjunyantmsft_0-1710985222898.png

vjunyantmsft_1-1710985233094.png

Still choose these columns and click Unpivot:

vjunyantmsft_2-1710985274211.png

vjunyantmsft_3-1710985284034.png

Choose column "Attribute" and column "Value", then select Pivot:

vjunyantmsft_4-1710985353029.png

And the final output is as below:

vjunyantmsft_5-1710985382402.png

Then add a custom column and change the data type into Whole Number:

vjunyantmsft_6-1710985429061.png

vjunyantmsft_7-1710985440411.png

Choose "Close & Apply":

vjunyantmsft_8-1710985470547.png

Use this DAX to create a measure:

 

Percentage = 
VAR _a = MAX('Table'[Custom])
VAR _b = COUNTROWS(ALL('Table'))
RETURN
DIVIDE(_a, _b)

 

And the final output is as below:

vjunyantmsft_9-1710985826472.png

 

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

View solution in original post

4 REPLIES 4
v-junyant-msft
Community Support
Community Support

Hi @jimmyg706 ,

You measures are right. But if you have a very large number of columns, you will need to create a very large number of measures to fulfill your needs, and this can become cumbersome. There's no way this can be done with just one measure either.
If you can use Power Query Editor, it may be easier but it will add six more columns in your table without any measures. This method is not much different in terms of memory consumption than if you were to create a lot of measures, but it can be much easier to work with.
First, in Power Query and choose all of these columns and replace values:

vjunyantmsft_0-1710985222898.png

vjunyantmsft_1-1710985233094.png

Still choose these columns and click Unpivot:

vjunyantmsft_2-1710985274211.png

vjunyantmsft_3-1710985284034.png

Choose column "Attribute" and column "Value", then select Pivot:

vjunyantmsft_4-1710985353029.png

And the final output is as below:

vjunyantmsft_5-1710985382402.png

Then add a custom column and change the data type into Whole Number:

vjunyantmsft_6-1710985429061.png

vjunyantmsft_7-1710985440411.png

Choose "Close & Apply":

vjunyantmsft_8-1710985470547.png

Use this DAX to create a measure:

 

Percentage = 
VAR _a = MAX('Table'[Custom])
VAR _b = COUNTROWS(ALL('Table'))
RETURN
DIVIDE(_a, _b)

 

And the final output is as below:

vjunyantmsft_9-1710985826472.png

 

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

jimmyg706
Helper IV
Helper IV

Im sure there is an easier way, but I achived my desired affect

 

jimmyg706_1-1710968565200.png

 

jimmyg706
Helper IV
Helper IV

Ive managed to get the measures

 

 

 

QA Colmumn 1 Measure = if(max('Sheet1'[Column 1])="",0,1)
QA Colmumn 2 Measure = if(max('Sheet1'[Column 2])="",0,1)
QA Colmumn 3 Measure = if(max('Sheet1'[Column 3])="",0,1)
QA Colmumn 4 Measure = if(max('Sheet1'[Column 4])="",0,1)
QA Colmumn 5 Measure = if(max('Sheet1'[Column 5])="",0,1)

 

 

jimmyg706_0-1710967901518.png

 

Now I just need to add them all and get a %

jimmyg706
Helper IV
Helper IV

So for a clauclated column this would work

 

QA Colmumn 1 = if(ISBLANK(Sheet1[Column 1]),0,1)
QA Colmumn 2 = if(ISBLANK(Sheet1[Column 2]),0,1)
QA Colmumn 3 = if(ISBLANK(Sheet1[Column 3]),0,1)
QA Colmumn 4 = if(ISBLANK(Sheet1[Column 4]),0,1)
QA Colmumn 5 = if(ISBLANK(Sheet1[Column 5]),0,1)

 

But thats adding data.

 

Still checking a measure to produce the same result

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.