Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
First of all apologies if this is a duplicate request, I am trying to create a measure that will count multiple columns, if any of the rows are blank then it would return 0. The columns are ID number, start date, start time - if any of these are blank then I would need it to return 0, also if any of the rows in all 3 column are all the same I need it count the number of entries it appears in the entire dataset.
Please see table below, the 4th column named results is what I want my measure to return.
ID Start Date Start Time Results
1234 0
11/01/2021 15:30 0
9876 11/01/2021 09:05 1
9876 13/01/2021 13:45 1
3456 01/02/2021 19:30 2
3456 01/02/2021 19:30 2
6789 16/01/2021 19:30 3
6789 16/01/2021 19:30 3
6789 16/01/2021 19:30 3
Solved! Go to Solution.
Hi, @pardeepd84
Please try the below measure.
Result =
VAR currentid =
MAX ( 'Table'[ID] )
VAR currentdate =
MAX ( 'Table'[Start Date] )
VAR currenttime =
MAX ( 'Table'[Start Time] )
VAR newtable =
FILTER (
ALL ( 'Table' ),
'Table'[ID] <> BLANK ()
&& 'Table'[Start Date] <> BLANK ()
&& 'Table'[Start Time] <> BLANK ()
&& 'Table'[ID] = currentid
&& 'Table'[Start Date] = currentdate
&& 'Table'[Start Time] = currenttime
)
RETURN
COALESCE ( COUNTROWS ( newtable ), 0 )
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster.
Hi, @pardeepd84
Please try the below measure.
Result =
VAR currentid =
MAX ( 'Table'[ID] )
VAR currentdate =
MAX ( 'Table'[Start Date] )
VAR currenttime =
MAX ( 'Table'[Start Time] )
VAR newtable =
FILTER (
ALL ( 'Table' ),
'Table'[ID] <> BLANK ()
&& 'Table'[Start Date] <> BLANK ()
&& 'Table'[Start Time] <> BLANK ()
&& 'Table'[ID] = currentid
&& 'Table'[Start Date] = currentdate
&& 'Table'[Start Time] = currenttime
)
RETURN
COALESCE ( COUNTROWS ( newtable ), 0 )
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster.
@pardeepd84 , Try a measure like
countrows(Table)+0
or
countrows(Filter(allselected(Table),[ID] =max([ID])))
or
Count(Table[ID]) +0
or
CountX(Filter(allselected(Table),[ID] =max([ID])),Table[ID])
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 134 | |
| 96 | |
| 78 | |
| 67 | |
| 65 |