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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
TejasK
Frequent Visitor

Hi,I am trying to design a function so that my slicer acts only in the way I want it to.

TejasK_0-1673306115884.png

 

So I have 3 main groups, Group1, group 2 and group 3. 
At this stage I am inclined towards building a up a matrix visual such that if I select A, then I automatically get 4 measures Group 1 selected which shows value 100, than sum of all the remaining in group 1 which is 900 and then separately also show Group 2 and Group 3. Is this possible? 

 

1 ACCEPTED SOLUTION

@TejasK , not sure why you intend to use distinctcount, is it because you got duplicate in type. I'm attaching PBIX File. Can I see a broader range of dummy datasets to investigate further, ideally PBIX File. Many Thanks PBIX FILE 

View solution in original post

4 REPLIES 4
TejasK
Frequent Visitor

@Manoj_Nair - Thank you for your help. 
I have changed your DAX measures to do a count distinct and GRP1 Selected works fine but GRP1 NotSelected does not work. 
My DAX measures are as follows: 

GRP 1_Selected ( This one works well ) =
var _Type = SELECTEDVALUE(TBL3[TYPE])
return
CALCULATE(distinctcount(TBL3[ID]),FILTER(TBL3,(TBL3[TYPE]) =_Type && (TBL3[GROUP]) = "GROUP 1"))

GRP 1_NotSelected ( This one does not work ) =
var _Type = SELECTEDVALUE(TBL3[TYPE])
return
CALCULATE(distinctcount(TBL3[ID]),FILTER(TBL3,(TBL3[TYPE]) <>_Type && (TBL3[GROUP]) = "GROUP 1"))


The GRP1_NotSelected gives blank result. 



@TejasK , not sure why you intend to use distinctcount, is it because you got duplicate in type. I'm attaching PBIX File. Can I see a broader range of dummy datasets to investigate further, ideally PBIX File. Many Thanks PBIX FILE 

@Manoj_Nair - Thanks Manoj.
While trying to prepare a dummy data set and looking at some of the DAX videos, I was able to achieve what I wanted.
Getting some ideas from your DAX, I also managed to create DAX's for Group 2 and Group 3 asked originally in my post.
Thank you so much for all your help 🙂

Manoj_Nair
Solution Supplier
Solution Supplier

@TejasK - pls try this two DAX

image.jpg

If this post helps to find solution would be happy if you could mark my post as a solution and give it a thumbs up

 

Best regards

Manoj Nair

Linkedin - https://www.linkedin.com/in/manoj-nair-%E2%98%81-344666104/

 

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors