Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Janaki_Sankaran
Regular Visitor

DAX Query in Query Designer - How to make DISTINCT column

Hi,

I have a table called Store_DIM which has Region, District, Store columns. In the Power BI Report Builder while creating the dataset in the Query Designer, I dragged the Region column, that was not having duplicates at first. But as soon as I brought District column there are multiple repeated regions based on multiple districts under the same region.
Because of this I'm unable to properly create a Region Parameter. 
Here is the DAX Query for the same: - EVALUATE SUMMARIZECOLUMNS('V_STORE_DIM'[Region], 'V_STORE_DIM'[District], RSCustomDaxFilter(@VSTOREDIMRegion,EqualToCondition,[V_STORE_DIM].[Region],String), RSCustomDaxFilter(@VSTOREDIMDistrict,EqualToCondition,[V_STORE_DIM].[District],String))
The last two lines of this query is nothing but I'm bringing the Region and District Parameters created from the dataset, which I don't wanted to use, as this is causing issue when I map them to the Query parameters - as the Query Parameters are not becoming editable when I map the selected Region and District Parameters. Hence I want to point out the source dataset's corresponding table columns itself for the query parameters created. Can someone please help me with how to fix this DAX  Query, so that it should take only the distinct values of the Region and District columns to use them to map to the Query parameters?

Janaki_Sankaran_0-1711973720596.png

 

3 REPLIES 3
AnalyticPulse
Impactful Individual
Impactful Individual

you can use below dax to get distinct values.
EVALUATE
DISTINCT(
SUMMARIZE(
'V_STORE_DIM',
'V_STORE_DIM'[Region],
'V_STORE_DIM'[District]
)
)


mark this reply as answer is this resolves your issue.
If this helped, Follow this blog for more insightful information about data analytics:
https://analyticpulse.blogspot.com/2024/03/superstore-sales-2022-vs-2023-year-on.html
https://analyticpulse.blogspot.com/
Please Subscribe AnalyticPulse on YouTube for future updates:
https://www.youtube.com/@AnalyticPulse
Please subscribe CogniJourney On Youtube For Daily fun facts:
https://www.youtube.com/@CogniJourney

Hi @AnalyticPulse ,

I get to see the below error -

Janaki_Sankaran_1-1712064457831.png

 

thats strange i checked it with my table before post reply.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors