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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
Post Prodigy
Post Prodigy

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors