This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
This is the sample pbix I have done .This is the output I would obtain
I would obtain the number of customers for each month with the label defined in the measure m-mark = IF([sumlast3months]=3;"Gold"; IF([sumlast3months]=2;"Silver"; IF([sumlast3months]=1;"Bronze"; IF([sumlast3months]=0;"NotBuyer";BLANK())))) In the original file I have a label "New" too but it's expensive to add an other table. Do you have an idea?
Solved! Go to Solution.
Hi @garluc93,
since you cannot have a measure as a legend, you need to create a small table with the values you need on the legend. And then create a measure like this:
m-mark2 =
var _tmp = ADDCOLUMNS(VALUES(data2[Customer Number]);"SL3MO";[sumlast3months_v2])
var _mk = SELECTEDVALUE(Marks[Mark])
return
SWITCH(
TRUE();
_mk="Gold";COUNTROWS(FILTER(_tmp;[SL3MO] = 3));
_mk="Silver";COUNTROWS(FILTER(_tmp;[SL3MO] = 2));
_mk="Bronze";COUNTROWS(FILTER(_tmp;[SL3MO] = 1 ));
_mk="notBuyer";COUNTROWS(FILTER(_tmp;[SL3MO] = 0 ));
blank())
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
Hi @garluc93,
since you cannot have a measure as a legend, you need to create a small table with the values you need on the legend. And then create a measure like this:
m-mark2 =
var _tmp = ADDCOLUMNS(VALUES(data2[Customer Number]);"SL3MO";[sumlast3months_v2])
var _mk = SELECTEDVALUE(Marks[Mark])
return
SWITCH(
TRUE();
_mk="Gold";COUNTROWS(FILTER(_tmp;[SL3MO] = 3));
_mk="Silver";COUNTROWS(FILTER(_tmp;[SL3MO] = 2));
_mk="Bronze";COUNTROWS(FILTER(_tmp;[SL3MO] = 1 ));
_mk="notBuyer";COUNTROWS(FILTER(_tmp;[SL3MO] = 0 ));
blank())
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
Hi @sturlaws , you're precious. Do you have an idea to see New clients as the customer numbers that buy for the first time in the month visualized? I have done a measure but I'm not sure what it does
m-New =
VAR GROUPDATA= GROUPBY(Test;Test[Customer Number];Test[datalink];"FDT";MINX(CURRENTGROUP();Test[datalink]))
var _mk = SELECTEDVALUE(Marks[Mark])
RETURN
SWITCH(
TRUE();
_mk="New";COUNTROWS(FILTER(GROUPDATA;[FDT]>=FIRSTDATE(TimeIntelligence[Date])));
blank())
I have added a column revenue and this measure that looks function in your switch
NewCustomers =
COUNTROWS(FILTER(ADDCOLUMNS(VALUES(Test[revenue]);"PreviousRevenue";CALCULATE(COUNTROWS(Test);FILTER(ALL(TimeIntelligence);TimeIntelligence[Date]<MIN(TimeIntelligence[Date]))));[PreviousRevenue]=0))
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 25 | |
| 21 | |
| 18 | |
| 17 |
| User | Count |
|---|---|
| 62 | |
| 34 | |
| 33 | |
| 24 | |
| 23 |