March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi everyone,
I have the following sample file:
Segment | Country | Product | Discount Band |
Government | Germany | Carretera | None |
Government | Germany | Paseo | None |
Government | Canada | Paseo | None |
Government | Germany | Velo | None |
Government | France | VTT | None |
Government | France | Amarilla | None |
Government | Mexico | Carretera | Low |
Government | France | Carretera | Low |
Government | France | Paseo | Low |
I want to do the following:
Question: Is it possible to add such column to the existing table? How?
Segment | Country | Product | Discount Band | Q-ty of products |
Government | Germany | Carretera | None | 3 |
Government | Germany | Paseo | None | 3 |
Government | Canada | Paseo | None | 1 |
Government | Germany | Velo | None | 3 |
Government | France | VTT | None | 4 |
Government | France | Amarilla | None | 4 |
Government | Mexico | Carretera | Low | 1 |
Government | France | Carretera | Low | 4 |
Government | France | Paseo | Low | 4 |
I did it in the following way, but I want to improve it:
NewTable =
VAR t1 =
SUMMARIZECOLUMNS('Sample'[Country] , 'Sample'[Product])
VAR t2 =
GROUPBY(t1,
'Sample'[Country],
"NUmofProducts", COUNTX(CURRENTGROUP(),1))
RETURN
t2
NewMeasure =
CALCULATE(COUNTX(NewTable,NewTable[NUmofProducts]),NewTable[NUmofProducts]>1)
How can I receive the same results without creating a new table?
Thanks in advance!
Solved! Go to Solution.
what's the purpose of create the addtional column? you didn't use it when you create a new table
you can try this measure
Proud to be a Super User!
@PavelAndreev You could create a new column in your existing table like this:
Column = COUNTROWS(DISTINCT(SELECTCOLUMNS(FILTER('Table',[Country]=EARLIER('Table'[Country])),"Product",[Product])))
@PavelAndreev You could create a new column in your existing table like this:
Column = COUNTROWS(DISTINCT(SELECTCOLUMNS(FILTER('Table',[Country]=EARLIER('Table'[Country])),"Product",[Product])))
what's the purpose of create the addtional column? you didn't use it when you create a new table
you can try this measure
Proud to be a Super User!
@ryan_mayu , the column is needed for other purposes. Your new measure solution is great! Thanks!
you are welcome
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
163 | |
116 | |
63 | |
58 | |
50 |