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.
Hello everyone,
I've created a measure with the following DAX code:
semana pasada = CALCULATE(distinctcount('Table1'[Código Conflict]);
FILTER(ALL('Table1');
if(isfiltered('calendario'[weekday]);
'Table1'[weekdayconfl] = SELECTEDVALUE('Table1'[weekdayconfl]) && 'Table1'[weeknumconfl] = SELECTEDVALUE('Table1'[weeknumconfl]) - 1;
'Table1'[weeknumconfl] = SELECTEDVALUE('Table1'[weeknumconfl]) - 1)
))
Which combined with the following makes a percentual variation between weeks:
% = divide(DISTINCTCOUNT(Table1[Código Conflict]) - [semana pasada];[semana pasada])
The code works well if you don't use any filter like you can see here:
But everything goes wrong when you use any filter or interaction:
Can someone help me on this?
Thank you really much.
Hi @Anonymous ,
How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?
Best regards,
Hi @Anonymous ,
We can use the following measure to meet your requirement.
semana pasada =
CALCULATE (
DISTINCTCOUNT ( 'Table1'[Código Conflict] ),
FILTER (
ALLSELECTED ( 'Table1' ),
IF (
ISFILTERED ( 'calendario'[weekday] ),
'Table1'[weekdayconfl] = SELECTEDVALUE ( 'Table1'[weekdayconfl] )
&& 'Table1'[weeknumconfl]
= SELECTEDVALUE ( 'Table1'[weeknumconfl] ) - 1,
'Table1'[weeknumconfl]
= SELECTEDVALUE ( 'Table1'[weeknumconfl] ) - 1
)
)
)
Please try to change ALL function to ALLSELECTED function
If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to OneDrive For Business and share the link here.
Best regards,
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
96 | |
95 | |
82 | |
71 | |
64 |
User | Count |
---|---|
116 | |
106 | |
94 | |
79 | |
72 |