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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
hasharma19
Helper II
Helper II

Calculate True and False Output

Dear All,
I have an issue wherein i want to count the true and false value.
I had creted a measure which is giving me true and False output. It is giving True wherever the rating is compliant and false for others. Now i need the count of True and False.
Please help me incorporating the same.

hasharma19_0-1684065262597.pnghasharma19_1-1684065285020.pnghasharma19_2-1684065296026.png

hasharma19_3-1684065320158.png

 

12 REPLIES 12
hasharma19
Helper II
Helper II

@Ahmedx -Thanks a ton for the DAX.
However, ths issue still persist.

The below table i have created with DAX:-

Dist = CALCULATE(COUNTAX(SUMMARIZE('DG Audit Reports','DG Audit Reports'[Site Reviewed],"MaxT", COUNT('DG Audit Reports'[Year])), [MaxT]))
The total supposed to have 42 instead it is giving 40.
Similarly, the DAX you have shared also goving 40 count too.
Can you please relook it. Thanks 

hasharma19_0-1684098707645.png

 

You need to write another measure like this

count of True Fixed = SUMX(VALUES('Date'[Year]),[count of True ])

@Ahmedx -Thank you very much for all the support!
How i can get rid of future 0.00% values.
have used 2 measures

1-_2023 = VAR DEL=CALCULATE([_DECat]/[_HAWBCount],DimDate[ISOYear]=2023)

RETURN

IF(ISBLANK(DEl),0,DEl)

 

for filtering out false

2-(MAXDate = DimDate[Date]<=MAX (Delivery_Exce[ERDF NC Date])

hasharma19_0-1684136317392.png

 



I'm not sure I understand you but try to write

1-_2023 = VAR DEL=CALCULATE(DIVIDE([_DECat],[_HAWBCount]),DimDate[ISOYear]=2023)

RETURN

IF(ISBLANK(DEl),0,DEl)

@Ahmedx DAX shared by you not working and the furture week (i.e 18, 19, 20...so on ) showing 0.00% whereas there is no data of those weeks in source file.
Want to show 2022 data from WK01-WK52 and 2023 WK01-WK17 and whereven the future data added same reflect in graph.

Share sample pbix file to help you.

@Ahmedx Is there any emaill addess, will share through onedrive.

file size is bit high

@Ahmedx Uploded- visuals also not working properlly 

@Ahmedx -Thanks!

What changes i should apply to this DAX-Dist = CALCULATE(COUNTAX(SUMMARIZE('DG Audit Reports','DG Audit Reports'[Site Reviewed],"MaxT"COUNT('DG Audit Reports'[Year])), [MaxT]))

so that i can  get the total count of site reviewed is 42
Or please suggest the DAX.
I have 42 site but while applying this dax getting 40.

hasharma19_0-1684124671433.png

 



 

DAX-Dist Fixed = SUMX(VALUES('Date'[YEAR]),[DAX-Dist ])

Ahmedx
Super User
Super User

pls tru this

count of True = 
VAR _tbl = 
    FILTER(ADDCOLUMNS(VALUES('table'[Site Reviewed]),"Flag", [_COM]),[Flag]=1)
RETURN
COUNTROWS(_tbl)
------
count of False = 
VAR _tbl = 
    FILTER(ADDCOLUMNS(VALUES('table'[Site Reviewed]),"Flag", [_COM]),[Flag]=0)
RETURN
COUNTROWS(_tbl)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.