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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Power BI Dax Calculate with filter for two different cases

 

sug190_8-1689879028807.png

 

 

Table - Visual 1, 
Deal Stage By number of deals -  Visual 2, 
Deals By Dwell time - Visual 3

 

 

I have a report that shows a deal in different stages. Once the deal movers into customer it is finalized. The two visuals on the right show diffrent aggregations of the visual. I would like to hide the customer data bar unless the customer cell in the table has been clicked. 

I have created a measure to hide  as per 2nd visual. But I cant seem to input a swith/if statement to only show deals  that are in customer stage if the customer column has been selected in the table.

 
Here are my Dax

dealsInProgress =

Var _count = CALCULATE(

    COUNT(

        dealHistory[stage]

    ) ,

      FILTER(

        VALUES( 'dealHistory'[dtStart]),

         'dealHistory'[dtStart] <= MAX( 'date'[Date])

    ),

    FILTER(

        VALUES( 'dealHistory'[dtEnd]),

            'dealHistory'[dtEnd]>= MIN( 'date'[Date] )

    ),

        FILTER('dealHistory', [dtStart]<>[dtEnd]),

        FILTER('dealHistory',[stage]<>"Customer")

       

)

return _count

allDealsMeasure dealsInProgress =

 

Var _count = CALCULATE(

    COUNT(

        dealHistory[stage]

    ) ,

      FILTER(

        VALUES( 'dealHistory'[dtStart]),

         'dealHistory'[dtStart] <= MAX( 'date'[Date])

    ),

    FILTER(

        VALUES( 'dealHistory'[dtEnd]),

            'dealHistory'[dtEnd]>= MIN( 'date'[Date] )

    ),

        FILTER('dealHistory', [dtStart]<>[dtEnd]),

        FILTER('dealHistory',[stage]<>"Customer")

       

)

return _count

 

I would like to do either a switch statement, or if statement, that would only customers in customer stage when the user clicks the customer column from Table 1. If customer stage has not been clicked to leave out customer. Please see below for correct action.

Correct Action: When customer cell in table 1 is not clicked 

 

sug190_9-1689879188386.png

 

 

Correct Action: When customer cell in table 1 is clicked

 

sug190_10-1689879195346.png

 All data is comming fro one table 

sug190_11-1689879254338.png

 

 

I have created an if statement but it always default to false and shows whatever I put as false. 



Thank you for your help 😄

1 REPLY 1
foodd
Super User
Super User

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.