Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have a LOD calculation in tableau as below.
{FIXED [Casenumber],[Adobe Date],[Account_Name__C],[Contact_Name__C],[Case Created Date],[Fiscal Date],[SEARCH_TERM],[Asset Name]
: COUNTD(IF ([Scenario (trim)] = 'Web activities but No Case Created')
THEN [Casenumber] END)
}
It returns a distinct count of casenumbers based on the columns mentioned in the fixed syntax.
I tried converting the same in Power bi using the below DAX. But i am not getting correct output.
Hi @Ritika0307
CALCULATE(
DISTINCTCOUNT(
IF(
[Scenario (trim)] = "Web activities but No Case Created",
[Casenumber]
)
),
FILTER(
ALL(
'Table'[Casenumber],
'Table'[Adobe Date],
'Table'[Account_Name__C],
'Table'[Contact_Name__C],
'Table'[Case Created Date],
'Table'[Fiscal Date],
'Table'[SEARCH_TERM],
'Table'[Asset Name]
),
'Table'[Casenumber] = MAX('Table'[Casenumber]) &&
'Table'[Adobe Date] = MAX('Table'[Adobe Date]) &&
'Table'[Account_Name__C] = MAX('Table'[Account_Name__C]) &&
'Table'[Contact_Name__C] = MAX('Table'[Contact_Name__C]) &&
'Table'[Case Created Date] = MAX('Table'[Case Created Date]) &&
'Table'[Fiscal Date] = MAX('Table'[Fiscal Date]) &&
'Table'[SEARCH_TERM] = MAX('Table'[SEARCH_TERM]) &&
'Table'[Asset Name] = MAX('Table'[Asset Name])
))
Best Regards,
Shreya
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
Hi @Ritika0307
To replicate the behaviour of this FIXED LOD calculation, I would suggest using REMOVEFILTERS/SUMMARIZE rather than ALLEXCEPT.
I believe this should work as expected:
Self_service_success =
CALCULATE (
DISTINCTCOUNT ( 'TB'[CASENUMBER] ),
'TB'[SCENARIO] = "Web activities but No Case Created",
-- Remove filters on TB table...
REMOVEFILTERS ( 'TB' ),
-- ...but add back a filter corresponding to visible combinations of these columns
SUMMARIZE (
'TB',
'TB'[CASENUMBER],
'TB'[V05_DATE],
'TB'[ACCOUNT_NAME__C],
'TB'[CONTACT_NAME__C],
'TB'[CREATEDDATE],
'TB'[FISCAL_MONTH],
'TB'[V02_SEARCH_TERM],
'TB'[V20_ASSET_NAME]
)
)
The reason not to use ALLEXCEPT in this case is that it will only retain filters that exist on the specific columns listed, but will not retain values in those columns resulting in crossfiltering from other columns. In Tableau, FIXED does retain filters resulting from crossfiltering on the listed columns.
Does the above expression work as expected?
Regards
Hello , i tried the above calculation , seems like after summarizing the columns it is only returning the distinct count of the casenumber. I want to see the count of the distinct rows the summarize statement is returning. ( I believe summarize is similar to group by).
If possible , i want to get DAX calculation equivalent to this sql statement.
SELECT sum(count(DISTINCT(CASENUMBER))) FROM TB WHERE SCENARIO ='Web activities but No Case Created' GROUP BY V05_DATE ,ACCOUNT_NAME__C ,CONTACT_NAME__C ,CREATEDDATE ,FISCAL_MONTH ,V02_SEARCH_TERM ,V20_ASSET_NAME ;
Thanks
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 12 | |
| 9 | |
| 5 | |
| 5 |