Forum Discussion
How to count rows based on two criteria?
- Anonymous2 years ago
Hi maximik
1.You can create a slicer table
Slicer = {"Counts","Counts>0"}2.Then create a measure
Counts = IF ( OR ( ISFILTERED ( Slicer[Value] ) = FALSE (), SELECTEDVALUE ( Slicer[Value] ) = "Counts" ), CALCULATE ( COUNTA ( 'Table'[VM/Instance in that scale Set] ) ), IF ( SELECTEDVALUE ( Slicer[Value] ) = "Counts>0", CALCULATE ( COUNTA ( 'Table'[VM/Instance in that scale Set] ), FILTER ( 'Table', [Max CPU performance] > 0 ) ) ) )3.Then create a column visual, put the time to the x-axis, and put the measure to y-axis, then put the virtual to legend, and put the value of slicer table to a slicer.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi maximik
1.You can create a slicer table
Slicer = {"Counts","Counts>0"}
2.Then create a measure
Counts =
IF (
OR (
ISFILTERED ( Slicer[Value] ) = FALSE (),
SELECTEDVALUE ( Slicer[Value] ) = "Counts"
),
CALCULATE ( COUNTA ( 'Table'[VM/Instance in that scale Set] ) ),
IF (
SELECTEDVALUE ( Slicer[Value] ) = "Counts>0",
CALCULATE (
COUNTA ( 'Table'[VM/Instance in that scale Set] ),
FILTER ( 'Table', [Max CPU performance] > 0 )
)
)
)
3.Then create a column visual, put the time to the x-axis, and put the measure to y-axis, then put the virtual to legend, and put the value of slicer table to a slicer.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.