Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi, I need to display Country and Customer coming from different Dim tables and show them in rows in matrix visual. The field ( Product) in Columns in Matrix is from a different Dim table all connected to Fact table by one-to-many relationship.
The below measure works fine when I have either Country or Customer in rows, but as soon as I add both fields, the measure doesn't like it.
I need to basically highlight the minimum value for each Product column by using the below measure in Conditional formatting.
The measure I tried -
Background Measure =
VAR _1 = CALCULATETABLE(
ADDCOLUMNS
(SUMMARIZE('Fact','Dim Country'[Country], 'Dim Product'[Product]),
"@Amt", [Value]
),
ALLSELECTED(''Dim Product'[Product])
)
var MinValue = MINX(_1, [@Amt])
var MaxValue = MAXX(_1, [@Amt])
var CurrentValue = [Value]
var Result =
SWITCH(TRUE(),
CurrentValue = MinValue, 1,
CurrentValue = MaxValue, 2, BLANK())
RETURN Result
If I add Country to rows in matrix and customer coming from Dim Customer[Customer] to the above measure in summarize, it does not give right result. It only works when I have one field say Country in rows and product in columns.Could someone guide on what I am doing wrong? I need the below output when both Country and Customer are in rows.
Hi @askpbiuser your part for SUMMARIZE define "later" output
SUMMARIZE('Fact','Dim Country'[Country], 'Dim Product'[Product])
combined with ALLSELECTED(''Dim Product'[Product]) which "missing" Dim Customer table / some column
Try to add to this part what you need, like customer.
Hope this help. Kudos appreciated.
Proud to be a Super User!
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |