Forum Discussion
Getting a table from a measures and slicer values
- 7 years ago
Hi azeem_3a ,
Based on what you have presented I can duplicate your requested output. I have added a column in Power Query, although you can add it in Power BI. Simple if statement comparing the Plan and Actual and if not equal give it a 1. Call it Not completed. My table is call code. Then a measure.
Distinct count of projects = DISTINCTCOUNT(code[Code])
and another
Completed projects = [Distinct count of projects] - max(code[Not completed])
works on a card or table.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Hi azeem_3a ,
Please give us more information, First, is this a classroom assignment or a business assignment? Second, what software are you worrking with? Does not my picture match your expected results?
Thank you,
Nathaniel
Hi Nathaniel_C
Im using Power Bi and I need a dax to solve the issue.
In your picture, I get the answer I want when I click a particular month.
When I click the months Jan,Feb,March,April(ALL at Once) the result is different.
What I want is, if I select ALL months until April, it should give this result
| Class | Completed Codes |
| A | 2 |
| B | 2 |
When I click ALL Months until May, it should give me this result
| Class | Completed Codes |
| A | 1 |
| B | 2 |
Hope you understand the question.
Thanks
- Nathaniel_C7 years ago
Community Champion
Hi azeem_3a ,
Sorry, I did miss that you were going to select multiple months.
- Nathaniel_C7 years ago
Community Champion
Hi azeem_3a ,
So are these codes cumulative? What if April was the uncompleted code, and we went Jan - May, and May was completed would we get a zero or a one for that code?
Thanks,
- Nathaniel_C7 years ago
Community Champion
Hi azeem_3a ,
Based on what you have presented I can duplicate your requested output. I have added a column in Power Query, although you can add it in Power BI. Simple if statement comparing the Plan and Actual and if not equal give it a 1. Call it Not completed. My table is call code. Then a measure.
Distinct count of projects = DISTINCTCOUNT(code[Code])
and another
Completed projects = [Distinct count of projects] - max(code[Not completed])
works on a card or table.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel