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.
State | Station |
Newyork | S1 |
Newyork | S2 |
California | S3 |
California | S4 |
California | S5 |
Expected | |||
State | Station Count | Group | |
Newyork | 2 | Two | |
California | 3 | 3 or More | |
Actual-incorrect | |||
State | Station Count | Group | |
Newyork | 2 | Two | |
California | 3 | Two |
What is incorrect in the below formula for Group ? Result is incorrect as shown above.
Station Count=DistinctCount(Table([Station])
Group =If ([Station Count]>2,"3 or More","Two"
Solved! Go to Solution.
Hi, @curiouspbix0
According to your description, I think that you want to convert the measure into a calculated column so that you can use it in the Slicer, am I right?
You can try my columns:
Station Count1 = CALCULATE(DistinctCount('Table'[Station]),ALLEXCEPT('Table','Table'[State]))
Group1 = If ([Station Count1]>2,"3 or More","Two")
And you can get what you want, like this:
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @curiouspbix0
I have tried your measure, it can work correctly, you should check it again. If you still have a problem, you can try my Calculated table, it can work as good:
Expected =
SUMMARIZE('Table',
[State],
"Station Count",DISTINCTCOUNT('Table'[Station]),
"Group",IF([Station Count]>=3,"3 or More","Two"))
And you can get what you want, like this:
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @curiouspbix0 ,
Seems to work fine with the measures.
Station Count = DISTINCTCOUNT('Table'[Station])
Group = If ([Station Count]>2,"3 or More","Two")
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi, @curiouspbix0 , all seems to work correctly on my side
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@curiouspbix0
Do the Measure in this way:
Station Count =
IF( COUNTROWS(Table1) > 2 , "3 or More","Two")
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Why would a column not work but a measure works for the same formula ? Aggregation ?
There are additional columns in the table that are not listed up in the sample.
Cannot add measure to a drop down filter, how do you get the column working ?
Hi,
You may download my PBI file from here.
Hope this helps.
What is the Bracker formula ( Column ) ? Not available in PBIX
Measure works fine, how about the column so slicer works.
Hi,
I do not know whom you are replying to? Doesn't my solution solve your question? It is a measure solution and as you can see there is also a slicer.
Hi, @curiouspbix0
According to your description, I think that you want to convert the measure into a calculated column so that you can use it in the Slicer, am I right?
You can try my columns:
Station Count1 = CALCULATE(DistinctCount('Table'[Station]),ALLEXCEPT('Table','Table'[State]))
Group1 = If ([Station Count1]>2,"3 or More","Two")
And you can get what you want, like this:
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
118 | |
107 | |
70 | |
70 | |
43 |
User | Count |
---|---|
148 | |
106 | |
104 | |
89 | |
65 |