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.
I made a DAX measure:
Measure = CALCULATE(COUNT(Sheet1[Status]),FILTER(Sheet1,[MonthUpdated]="201810" && [Status]="Alpha"))
I also created a parameter YYYYMM to represent [MonthUpdated], to permit the user to choose month of interest for Alpha projects.
Measure = CALCULATE(COUNT(Sheet1[Status]),FILTER(Sheet1,[MonthUpdated]=YYYYMM && [Status]="Alpha"))
2 issues:
1 - When I make a slicer for the parameter, only one option exists (ie 201809 or 201810, or whatever I set the default value on), and none of the other options are available
2 - When I reference the parameter in the DAX equation, the calculation is incorrect
Any suggestions?
Solved! Go to Solution.
Hi @ahuhn
You can get the other count which is not selected by slicer with below measure.
Measure =
CALCULATE (
MAX ( Sheet1[MonthUpdated] ),
FILTER (
Sheet1,
Sheet1[MonthUpdated] <> SELECTEDVALUE ( Slicer[YYYYMM] )
&& Sheet1[Status] = "Alpha"
)
)
Regards,
Cherie
Hi @ahuhn
You may create a slicer table as below. Then create a measure with SELECTEDVALUE Function to get the value as requested.
Count = CALCULATE ( COUNT ( Sheet1[Status] ), FILTER ( Sheet1, Sheet1[MonthUpdated] = SELECTEDVALUE ( Slicer[YYYYMM] ) && Sheet1[Status] = "Alpha" ) )
Regards,
Cherie
@Anonymous that is great, I love it!
Just a follow up.
I want to be able to subtract another month's value, also being chosen by the user. I tried your method, but after selecting the slicer to 201809, the second slicer is also subsetted, and thus has only one option.
This is the reason I was trying to use parameters
Any suggestions? Can you answer here, or shall I create a new thread?
Hi @ahuhn
You can get the other count which is not selected by slicer with below measure.
Measure =
CALCULATE (
MAX ( Sheet1[MonthUpdated] ),
FILTER (
Sheet1,
Sheet1[MonthUpdated] <> SELECTEDVALUE ( Slicer[YYYYMM] )
&& Sheet1[Status] = "Alpha"
)
)
Regards,
Cherie
I forgot to add screenshot:
@ahuhn it is not clear what you are trying to do? Are you setting value for parameters? Why you are setting it as a slicer? Could you provide more details.
Please look at this link on how to get your answer quickly
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi,
Can you share sample dumy data and tell what are the results expected.
Thank you
Status | MonthUpdated |
Alpha | 201810 |
Alpha | 201810 |
Beta | 201810 |
Gamma | 201810 |
Gamma | 201810 |
Alpha | 201809 |
When user selects parameter 201810, alpha result should be 2
when user seelcts 201809, alpha result should be 1
Unforunately, the parameters cannot be altered either
@ahuhn so if I understood correctly, you have a parameter which user uses to enter the month value and then you want to show count of status based on month value entered by users in parameter, correct?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |