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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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