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
ymirza
Helper II
Helper II

Percentage of False in a column from a Month row

I have table with name, month and rate. What would be the appropriate DAX to measure percentage of False only from that specifc month (not the total column of Rate)?

for e.g. Jan has 6 names and 3 false. should return 50% under Jan.

MonthNameRate
JanAdamTRUE
JanMarkFALSE
JanJaneTRUE
JanJacobFALSE
JanStevenTRUE
JanJonesFALSE
FebAdamTRUE
FebMarkFALSE
FebJaneTRUE
FebJacobFALSE
FebStevenTRUE
FebJonesFALSE
MarAdamTRUE
MarMarkFALSE
MarJaneTRUE
MarJacobFALSE
MarStevenTRUE
MarJonesFALSE

 

1 ACCEPTED SOLUTION

Some of the months are not covered with TRUE statements, that is why the DAX you shared was effective only at individual row level, but not the Grant total. 

 
 

2019-12-19_14-07-06.png

What I did using your DAX is created another measure

 
Total % = IF(HASONEVALUE(Sheet1[Month]),[PercMeasure],   AVERAGEX(VALUES(Sheet1[Month]),[PercMeasure]))
 
  2019-12-19_14-16-18.png

View solution in original post

5 REPLIES 5
JarroVGIT
Resident Rockstar
Resident Rockstar

Create a measure like this:

PercMeasure: = COUNTROWS(FILTER(Table3, Table3[Rate] = TRUE)) / COUNTROWS(Table3)

 

Kind regards

Djerro123

-------------------------------

If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

Keep those thumbs up coming! 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




As a start this is good, I am getting individual measures correct for each month.

but the grand total is calculating on all rows instead of specific rows.

 

for e.g. if Month of Feb has all False, filter is still using Feb to divide the grant total. 

 

Is there any DAX that only calculates the TRUE from each month and returns grand total based on the TRUE found in those months?

Hi @ymirza
 
First of all, my [rate] column is text data type, and then I create a calculated column:

 

 

COUNT_TRUE = CALCULATE(
            COUNT(Sheet6[Rate]),
            FILTER(Sheet6,
            Sheet6[Rate]="TRUE"&&
            Sheet6[Month]=EARLIER(Sheet6[Month])))

 

 

count_trueCapture.PNG

 

The same way to calculate the number of months, you can get the rate of each month.

 

count_rate.PNG

 

 

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

 

I don't understand what you mean. Can you give a self calculated example? I looked at your question again and you asked for measure that would work per month, isn't that what you are looking for?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Some of the months are not covered with TRUE statements, that is why the DAX you shared was effective only at individual row level, but not the Grant total. 

 
 

2019-12-19_14-07-06.png

What I did using your DAX is created another measure

 
Total % = IF(HASONEVALUE(Sheet1[Month]),[PercMeasure],   AVERAGEX(VALUES(Sheet1[Month]),[PercMeasure]))
 
  2019-12-19_14-16-18.png

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.