Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi Team,
I need help on Distinct Columns in a table using Measure.
Here is my Query. My Table is as follows. We need to get the Distinact Values from all the rows of a table and get Some of one column.
Based on all Columns we need to get the Distnict Values and get the Sum of FS_Amount column value
Here in the above image i need to get the Distinct rows based on Supplier, feedback Amount, Category, Street Addres, City, State, Lattitute, Langitute. (Ie. there might be chance that all the Columns are same except one column. in that case we will consider it as Distinct. We need to eliminate all the column values are same.)
Once we get the Disctinict rwos, need to get the count of the Feedstock amount based on the results.
Solved! Go to Solution.
@SureshPydi1 So like this?
Measure =
VAR __Table =
SUMMARIZE(
'Table',
[Supplier], [Category], [Street Address], [City], [State], [Latitude], [Longitude],
"__FSAmount", SUM([Feedstock Amount])
)
VAR __Result = COUNTROWS(DISTINCT(__Table))
RETURN
__Result
Hi @Greg_Deckler ,
Thanks Somuch for your help. I have changed the logic and i am able to achive the requirement.
Here is the updated query
In the code i have updated the filter and updated the Sum to Max to get the Sum of the column.
Measure=
VAR __Table =
Filter(SUMMARIZE(
'SupplierByFarmRadius',
[Supplier],[Category],[StreetAddress],[City],[State],[AddressTypeID],
"__FSAmount", MAX([FS_Amount])
),SupplierByFarmRadius[AddressTypeID]<>1)
VAR __Result = SumX(DISTINCT(__Table),[__FSAmount])
RETURN
__Result
Hi @Greg_Deckler ,
Thanks Somuch for your help. I have changed the logic and i am able to achive the requirement.
Here is the updated query
In the code i have updated the filter and updated the Sum to Max to get the Sum of the column.
Measure=
VAR __Table =
Filter(SUMMARIZE(
'SupplierByFarmRadius',
[Supplier],[Category],[StreetAddress],[City],[State],[AddressTypeID],
"__FSAmount", MAX([FS_Amount])
),SupplierByFarmRadius[AddressTypeID]<>1)
VAR __Result = SumX(DISTINCT(__Table),[__FSAmount])
RETURN
__Result
@SureshPydi1 So like this?
Measure =
VAR __Table =
SUMMARIZE(
'Table',
[Supplier], [Category], [Street Address], [City], [State], [Latitude], [Longitude],
"__FSAmount", SUM([Feedstock Amount])
)
VAR __Result = COUNTROWS(DISTINCT(__Table))
RETURN
__Result
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
91 | |
89 | |
79 | |
69 | |
68 |
User | Count |
---|---|
222 | |
128 | |
117 | |
82 | |
77 |