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.
I have a question regarding the outcome of a query.
DEFINE MEASURE 'Source'[DistinctCount] = DISTINCTCOUNT('Source'[Source]) MEASURE 'Allocation'[DistinctCountRows] = COUNTROWS ( FILTER ( VALUES ( Source[Source] ), COUNT('Allocation'[QUANTITY]) > 0 ) ) MEASURE 'Allocation'[AllocationNew] = IF( --ISFILTERED('Source'[Source]) && DISTINCTCOUNT('Source'[Source]) > 1 COUNTROWS ( FILTER ( VALUES ( Source[Source] ), COUNT('Allocation'[QUANTITY]) > 0 ) ) > 1 ,"N/A (multiple sources selected)" ,IF( COUNTROWS ( FILTER ( VALUES ( Allocation[LINEPACK_ALLOCATION_TYPE_ID] ), COUNT('Allocation'[QUANTITY]) > 0 ) ) > 1 && NOT ISBLANK('Allocation'[Allocation Count]), --DISTINCTCOUNT(Allocation[LINEPACK_ALLOCATION_TYPE_ID]) > 1 && NOT ISBLANK('Allocation'[Allocation Count]), "N/A (multiple allocation types selected)", SUM('Allocation'[QUANTITY]) ) ) EVALUATE SUMMARIZECOLUMNS ( Source[Source], "Sources", CALCULATE('Source'[DistinctCount]) ,"Countrows of sources", CALCULATE('Allocation'[DistinctCountRows]) ,"AllocationNew", CALCULATE('Allocation'[AllocationNew]) )
This results in:
When I put Source in comment the result is:
Though the desired result is [countrows of sources] = 1 and [AllocationNew] should contain a value, because there is only 1 source with a value. I think i'm almost there, but can't figure out what is wrong.
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 |
---|---|
39 | |
20 | |
19 | |
16 | |
15 |
User | Count |
---|---|
49 | |
26 | |
22 | |
17 | |
16 |