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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Black_magic100
Helper III
Helper III

Help with very simple DAX code

Okay so I have a table that contains the following columns (these are not actual names):

 

1) mainID  (a unique primary key ID)

2) Count1 (A simple DISTINCTCOUNT measure of an ID of a DIFFERENT table than above)

3) Count3 (A simple DISTINCTCOUNT measure of an ID of a DIFFERENT table than above)

4) FinalCount (This is simple a sum of the two measures above)

 

Now when I add these to a single table I get 5 rows because I am aggregating by the mainID.

 

However, when I add my final measure, which is seen below:

XXXXXX = SWITCH ( TRUE(), [yyyyyyyyy] <= 23, 40, [yyyyyyyyy] <= 35, 70, [yyyyyyyyy] <= 42, 100, [yyyyyyyyy] >= 43, 125, "Invalid")
 
I get a table that is now iterating through a ton of different values and the result is always showing 40 most likely because it is only counting 1 value?  I feel like this should be very simple, but for whatever reason that last SWITCH() statement is not wanting to just look at the final column and add the appropriate 5 rows.
3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @Black_magic100 ,

 

Did you try to put the meausre [yyyyyyyyy] in your visual to check the value of that? 

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @Black_magic100 ,

 

Has your issue been solved? If so, kindly mark my answer as a solution to close the case. If any other question, feel free to let me know please.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
TomMartens
Super User
Super User

Hey,

 

maybe this is because the mystery measure [yyyyyyyyy] always equals 23.

 

It seems necessary that you provide a pibx with some sample data (use the function Enter data), upload the file to onedrive or dropbox and share the link.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.