The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have the following matrix visual:
Both the column and row headers are determined by field parameters ('View by - A' & 'View by - B'), in this case, Career Band by Region.
The measure 'Hotspot Identified' returns text indicating a hotspot based on a 2 level Z-test (this bit is irrelevant but good for context).
What I would like to show in a card visual is the count of occurrences of the result 'Hotspot' within the matrix table, for the example above, this should be '2'.
I'm not sure if my thinking the following exists:
calculate ( count if ( 'Hotspot Identified' = "Hotspot"), for each intersection of 'View by - A' & 'View by - B')
I have added an idea Here and would appreciate a vote if you feel this would assist you in resolving a similar issue.
@Greg_Deckler Thanks for your assistance, though I can't get this to work to the needs.
There is no common table where (in the example [Career Band] and [Location]) exist to run the summarize on.
I attempted to crossjoin the 'View by - A' & 'View by - B' tables generated as part of them being field parameters, however this returns the list of fields rather than the items within those fields.
To illustrate with tocsv:
Additional:
I think my primary issue is not being able to use a variable as a table expression.
In the below:
The field parameter associated value for 'View By - A Fields' returns 'Dim_GCRFData'[CareerBand]
The field parameter associated value for 'View By - B Fields' returns 'Dim_LocationData'[Region]
TBLREF_A & TBLREF_B format the strings to be exactly as I would type in an expression for a table reference i.e. Dim_GCRFData & Dim_LocationData respectively.
I think I'd need to smash the crossjion within the summarize in order to reach the result.
@GaryWalton Try:
Measure =
VAR __Table =
ADDCOLUMNS(
SUMMARIZE( 'Table', [Career Band], [Location]),
"__Value", [Hotspot Identified]
)
VAR __Result = COUNTROWS(FILTER(__Table, [__Value] = "Hotspot"))
RETURN
__Result
User | Count |
---|---|
82 | |
81 | |
36 | |
32 | |
32 |
User | Count |
---|---|
93 | |
79 | |
62 | |
54 | |
51 |