Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi everybody!
I have these three tables: VR connected with Articles by Codigo, and VR with Clientes by CodCliente.
I want to count how many brands has each "CodClient", but it must have a postive sell. I tried to do it with a new table using:
CountBrands = summarize(VR,VR[CodCliente],Calendario[Year],Calendario[Month],"Cant marcas",DISTINCTCOUNT(Articles[Brand]),"Total Sales", SUM(Vr[Sales]))
(Calendario is an auxiliary calendar table.)
After that, I do a new measure
FinalMeasure = Calculate(AVERAGE(CountBrands'Cant Marcas'), CountBrands'Total Sales'>0)
And it seems to work, but i would like to do it in a measure, rather than a new table, but im not sure how to do it.
What do you recommend to me?
Thanks you all!
Compute the total sales for each brand and count how many of those are positive:
CountBrands =
VAR BrandSummary =
ADDCOLUMNS (
VALUES ( Articles[Brand] ),
"@SumSales", CALCULATE ( SUM ( VR[Sales] ) )
)
RETURN
COUNTROWS ( FILTER ( BrandSummary, [@SumSales] > 0 ) )
Edit: It might be even simpler to write like this:
CountBrands =
COUNTROWS (
FILTER ( VALUES ( Articles[Brand] ), CALCULATE ( SUM ( VR[Sales] ) ) > 0 )
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |