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.
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))
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 |
---|---|
109 | |
98 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |