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.
Table without restirictions has two dimensions Color and Number. Value cells has values from a measure (we can call it CellSum) that sums up values with these dimensions. I want to exclude all values below 4 from counted totals, but want to see these values in the matrix. See example. How can we achive this with dax code?
Table without restrictions:
Desired table (red lines just to show which values we want to exclude from totals):
Solved! Go to Solution.
Hi @irukandjix
I would suggest a measure along these lines (replace table/column references as needed):
CellSum Modified =
VAR Threshold = 4
RETURN
IF (
AND ( ISINSCOPE ( Number[Number] ), ISINSCOPE ( Color[Color] ) ),
[CellSum],
SUMX (
SUMMARIZE ( YourTable, Color[Color], Number[Number] ),
VAR CellSum = [CellSum] RETURN IF ( CellSum >= Threshold, CellSum )
)
)
ISINSCOPE is used to detect whether you are in an individual Color/Number cell.
Does something like this work for you?
Regards
Very nice solution, thank you @OwenAuger ! Your magic does exactly what is wanted!
Hi @irukandjix
I would suggest a measure along these lines (replace table/column references as needed):
CellSum Modified =
VAR Threshold = 4
RETURN
IF (
AND ( ISINSCOPE ( Number[Number] ), ISINSCOPE ( Color[Color] ) ),
[CellSum],
SUMX (
SUMMARIZE ( YourTable, Color[Color], Number[Number] ),
VAR CellSum = [CellSum] RETURN IF ( CellSum >= Threshold, CellSum )
)
)
ISINSCOPE is used to detect whether you are in an individual Color/Number cell.
Does something like this work for you?
Regards
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
31 | |
11 | |
10 | |
10 | |
9 |