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
Shamsbutt
Helper II
Helper II

Need help in writing DAX

Following DAX is fulfilling my basic requirement. But next thing i need to implement is

If multiple pi selected from slicer like PI26 and PI27 then data should be under more than 2PIs Yellow chart means

table should show only those items with PreviousPIsCount > 1

it should not show data with PreviousPIsCount = 1

 

Here is PBIX file

 

 

 

PICheck = 
IF (
    Fact_PI[PreviousPIsCount] > 1, "More Than 2 PI",
    IF ( Fact_PI[PreviousPIsCount] = 1, "Previous PI", "" )
)

 

 

 

Example:

 
 
 
 

In case of No Selection or single selection results are fine. Like below image

 

bbd6cf00-68e0-4a67-bc8c-e87e33906910.jpg

 

 

 

 

But in Below image case only more then 2 PIs should show data not in Previous

 

2.png

 

 

Thanks

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

hi @Shamsbutt ,

 

Please check following steps as below:

1.    Create measure:

       Measure 2 =

       VAR A =

           CALCULATE ( DISTINCTCOUNT ( 'Dim PI'[Name] ), ALLSELECTED ( Fact_PI ) )

       VAR B =

          MAX ( Fact_PI[PreviousPIsCount] )

       RETURN

           IF (

              ISBLANK ( B ),

              BLANK (),

               IF ( A = 6, 1, IF ( A = 1, 1, IF ( B = 1, BLANK (), 1 ) ) )

       )

2.    Add measure2 to visual filters.

1.PNG2.PNG

3.    Results would be shown as below:

3.PNG

Pbix as attached, hopefully works for you.

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

hi @Shamsbutt ,

 

Please check following steps as below:

1.    Create measure:

       Measure 2 =

       VAR A =

           CALCULATE ( DISTINCTCOUNT ( 'Dim PI'[Name] ), ALLSELECTED ( Fact_PI ) )

       VAR B =

          MAX ( Fact_PI[PreviousPIsCount] )

       RETURN

           IF (

              ISBLANK ( B ),

              BLANK (),

               IF ( A = 6, 1, IF ( A = 1, 1, IF ( B = 1, BLANK (), 1 ) ) )

       )

2.    Add measure2 to visual filters.

1.PNG2.PNG

3.    Results would be shown as below:

3.PNG

Pbix as attached, hopefully works for you.

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Shamsbutt
Helper II
Helper II

Help Please

 

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.