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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.