Forum Discussion

GREGBLACK's avatar
GREGBLACK
Regular Visitor
2 years ago

Creating DAX calculations based on Tableau Calculations

Hi all, new to the PBI world after years using Tableau.

Tryign to replicate a few, what I would call simple Tableau Clacs into DAX but struggling at present.

Any and all help appreciated.

 

Issue #1--trying to define an opportunity based on the fact that it has at least one occurrence of a named product--tableau calc below:

IF
{FIXED [OppID]: COUNTD(IF [Dim Desc Product 3C Category] = 'Managed Services' THEN [Fact Quantity] END)} = 0
THEN
'-'

ELSE
'Opp Contains Managed Services'
END

 

When I try to create the DAX calc -see below--it is not splitting out the Opportunties but returning all as ''Containing Managed Services' when I know only a handful do.

Contains MS =
VAR CountManagedServices = COUNTROWS(
    FILTER('Product', [dim_desc_product_3c_category] = "Managed Services")
)
RETURN
    IF(CountManagedServices = 0, "-", "Opp Contains Managed Services")
 
There are 2 tables that i have joined--an Opportunity table linked to the product table using ID Product in both--thus the Tableau calc is able to use a Fixed LOD calc at the Opp Level and count the instances where Managed Services exist---DAX is struggling with this.
 
Any ideas
 
Cheers
 
Greg

2 Replies

  • GREGBLACK's avatar
    GREGBLACK
    Regular Visitor

    Hi many thanks for your reply and it will  work great when I want to do a straight LOD but i think in DAX I need to nest the 2nd element of the LOD where I fixed the OPPid and then Count the times a ceetain product appears in any of the OPPIds---can this be done in DAX?

    Many thanks again

    Greg