Forum Discussion
Measure based on several conditions
Hi Aikeno ,
You can create a measure as below to get it, please find the details in the attachment.
Test done =
VAR _projectid =
SELECTEDVALUE ( 'Project'[Project_ID] )
VAR _vdv =
CALCULATE (
COUNT ( 'vw_vision_activity'[Activity_id] ),
FILTER (
ALLSELECTED ( 'vw_vision_activity' ),
'vw_vision_activity'[Project_ID] = _projectid
&& 'vw_vision_activity'[Activity_category] = "VDV"
)
)
VAR _closedvdv =
CALCULATE (
COUNT ( 'vw_vision_activity'[Activity_id] ),
FILTER (
ALLSELECTED ( 'vw_vision_activity' ),
'vw_vision_activity'[Project_ID] = _projectid
&& 'vw_vision_activity'[Activity_category] = "VDV"
&& 'vw_vision_activity'[Activity_state] = "Closed"
)
)
RETURN
IF ( ISBLANK ( _vdv ), "No VDV", IF ( _closedvdv = _vdv, "Yes", "No" ) )
Best Regards
- Aikeno2 years ago
Helper I
Thanks for your help !
It seem to works for you but on my side it does this:
I assume that i should have only one row for each project. It is the case when I delete the measure in this table.
- Anonymous2 years agoNot applicable
Hi Aikeno ,
Could you please provide some fake data in your tables (exclude sensitive data) with Text format and your expected result with special examples and screenshots? Later I will check why the formula is not working in your side and give you a suitable solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
- Aikeno2 years ago
Helper I
Hello,
Here is the simplified data :
https://www.mediafire.com/file/skwecp8ym4f6zuz/Power+BI+with+fake+data.pbix/file
For the blue table on the left, I would like to replace my measure to display "Yes" or "No" instead of the activites count and also be able to see all the project not only the one who have a Vibration review closed.
For the blue table on the right it seems to works on this simplified data but not in my real one can't explain why.