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
Anonymous
Not applicable

Include Lod of Tableau in Power BI

In Tableau We have Include LOD as below : 

 

{INCLUDE  [Region] : COUNTD([Categories])}

 

Need help to convert above calculation in PowerBI (Dax).

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

@Anonymous

I would suggest the below DAX to replicate the behaviour of an INCLUDE LOD in DAX, assuming you are aggregating with SUM:

 

=
SUMX (
    VALUES ( 'table'[Region] ),
    CALCULATE ( DISTINCTCOUNT ( 'table'[Categories] ) )
)

 

Tableau's INCLUDE is very similar to an iterator in DAX applied to the distinct values of a particular column.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi, can you help me convert 

Tableau query -     % QA Checks Completed = sum({ INCLUDE [Sam Name],[Asset Class Name]: COUNT([defect_status])/[QA Inspections Required] }) to Powerbi DAX 

jona4k
Frequent Visitor

I have some trouble getting a Tableau LOD statement in PowerBI. the Tableau expression is 
{fixed [column 1],[column 2],[column 3],[column 4],[column 5],[column 6]: [RP past retax]/[case count]}

I tried a DAX statement like this:
CALCULATE([RP past retax]/[case count],
ALLEXCEPT('table',[column 1],[column 2],[column 3],[column 4],[column 5],[column 6])
)

Sadly, the results do not match, any Idea what my missunderstanding about this is?

v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
OwenAuger
Super User
Super User

@Anonymous

I would suggest the below DAX to replicate the behaviour of an INCLUDE LOD in DAX, assuming you are aggregating with SUM:

 

=
SUMX (
    VALUES ( 'table'[Region] ),
    CALCULATE ( DISTINCTCOUNT ( 'table'[Categories] ) )
)

 

Tableau's INCLUDE is very similar to an iterator in DAX applied to the distinct values of a particular column.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Hi Owen, can you please share the DAX for below Tableau LOD with 2 columns. 

 

Example: {INCLUDE  [Region],[Category] : COUNTD([Categories])}

 

Thanks,

Jraj.

Hi @djraj2380 

Assuming you want to sum the distinct count of Categories for each Region/Category combination, it would be something like this:

SUMX (
    SUMMARIZE (
        YourTable,
        YourTable[Region],
        YourTable[Category]
    ),
    CALCULATE ( DISTINCTCOUNT ( YourTable[Categories] ) )
)

Replace YourTable with appropriate table name(s).

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

Try this formula as a measure, please.

 

Measure =
DISTINCTCOUNT ( 'table'[Categories] )

Then add the [Region] in a table visual with the Measure. The [Region] column is a context in the Power BI visuals. 

 

 

Best Regards,
Dale

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

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.