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 August 31st. Request your voucher.

Reply
yohanp17190
Frequent Visitor

Tableau to DAX help

I am trying to convert some dashboards that are in Tableau over to Power BI. I am still learning DAX functionalities but how would I convert the below calculated field to a DAX query?

SUM({ INCLUDE [Quarter]:
zn(COUNTD
(IF [Quarter]>='18-Q4' THEN
    if [TotalInteractionNumber]<> 'LEAD000001CH000001' and ([HoldFlag]=1) and [ActiveCampaignFlag]=1 then  [TotalInteractionNumber] END
  ELSE if [TotalInteractionNumber]<> 'LEAD000001CH000001' and ([HoldFlag]=1) then [TotalInteractionNumber] END
          END
  )
  )
   })
4 REPLIES 4
Anonymous
Not applicable

Hi @yohanp17190 ,

Based on the formula, it appears that you are trying to count the number of unique TotalInteractionNumber values for each quarter, where the TotalInteractionNumber is not equal to 'LEAD000001CH000001', the HoldFlag is 1, and the ActiveCampaignFlag is 1 for quarters after '18-Q4', and where the TotalInteractionNumber is not equal to 'LEAD000001CH000001' and the HoldFlag is 1 for quarters before '18-Q4'.

 

Please have a try.

column=
CALCULATE(
    COUNTROWS(
        FILTER(
            'Table',
            'Table'[TotalInteractionNumber] <> "LEAD000001CH000001" &&
            'Table'[HoldFlag] = 1 &&
            (
                'Table'[ActiveCampaignFlag] = 1 &&
                'Table'[Quarter] >= "18-Q4" ||
                'Table'[Quarter] < "18-Q4"
            )
        )
    ),
    ALL('Table'[Quarter])
)

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

 

Ashish_Mathur
Super User
Super User

Hi,

Share some data, explain the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
yohanp17190
Frequent Visitor

@amitchandak Thank you for your quick response. I did try to plug in the query that you provided but I dont think it is giving me the right output. 
I was given an explanation of what that calculated field is supposed to do. 

It is supposed to count the [TotalInteractionNumber] field, which is an ID field, only once for each quarter along with the other filters that have been applied. 

Would really appreciate it if you could help me with modifying your previous query. Ive been watching your videos and they have been really helpful.

amitchandak
Super User
Super User

@yohanp17190 , check if , this approch can help

LOD Include (Level Of Details): https://youtu.be/nmBVc2fN6aU

 

Use countx in this case with filter

 

example

CALCULATE(
COUNTX(VALUES('Table'[Quarter]), [Quarter]),
FILTER(
ALL('Table'),
[Quarter] < ( "18-Q4") &&
[TotalInteractionNumber] <> "LEAD000001CH000001" &&
[HoldFlag] = 1 &&
[ActiveCampaignFlag] = 1
)
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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