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
Human
Frequent Visitor

Help with total number of column that have a specific value

Hi,

I have a table that I need to calculate the total number of tanks that was active for the day either by dax or calculated column. These tanks are represented by each column and the active state is signified by the value of (1). So, for example, for 15/8/2023 should have 4 active tank since there are 4 column that have the value (1) registered. I've tried to sum up by rows but it was inaccurate as the active state for the tanks was not always aligned.

 

Human_0-1697184759744.png

Any help is much appreciated.

2 REPLIES 2
thuoc115
Advocate I
Advocate I

You standardize the data type

Thank you for your reply @thuoc115 but I'm not sure how to do that as I am fairly new to Power BI. But I found another solution to the problem by referring to this post = https://community.fabric.microsoft.com/t5/Desktop/Power-Query-count-columns-with-specific-values/td-... . I unpivot the related column on Power Query and used DISTINCTCOUNT on the attribute (tanks) on the Report View and it display what I wanted properly.

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.