Forum Discussion
EshaanG
Helper I
6 years agoHow to dynamically filter a table in PowerBI
I have a table in a data model which is like this : PersonID ProgramID Status 1 P1 Completed 2 P2 Completed 3 ...
v-easonf-msft
Community Support
6 years agoHi , EshaanG
If help , please refer to these steps:
1.create a calculate table as a slicer:
Table 2 = DISTINCT('Table'[ProgramID])
2.create measure "Measure 2" as the field "ProgramID" ,measure"Statue measure " as the field "Status" to apply to the table visual
Measure 2 = IF(CALCULATE(COUNTROWS('Table'),'Table'[ProgramID] in DISTINCT('Table 2'[ProgramID]))>0,MAX('Table'[ProgramID]),BLANK())Status measure =
IF (
CALCULATE ( COUNTROWS ( 'Table 2' ), ALLSELECTED ( 'Table 2' ) )
<> CALCULATE ( COUNTROWS ( 'Table 2' ), ALL ( 'Table 2' ) ),
IF (
CALCULATE (
COUNTROWS ( 'Table' ),
'Table'[ProgramID] IN DISTINCT ( 'Table 2'[ProgramID] )
) > 0,
"Completed",
"Not Started"
),
MAX ( 'Table'[Status] )
)
it will show as below:
Here is a demo.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.