Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi experts,
I'm a voluteer in an organisation that does shoots in hospitals from premature babies. So the parents have professional pictures of the babies. I'm helping them out making a power bi dashboard, but I'm stuck.
So I have a table with the shoots: date, hospital, photgrapher, shoot number.
I have another table with: photographer, hospital (this table is to define in which hospital the photographers do shoots).
I can easily get the number of shoots of a photographer and the number of shoots per hospital. But we want to know how many shoot a photographer has done on the total of shoots for the hospitals he was assigned to.
So something like this. It would be awesome to also have a time dimension. So the number of shoots and possible shoots in the last 3 months, this year,...
Photographer | Number of shoots | Number of possible shoots |
Photographer 1 | 3 | 7 |
Photographer 10 | 2 | 7 |
Photographer 11 | 2 | 74 |
Photographer 12 | 1 | 8 |
Photographer 13 | 1 | 19 |
Photographer 14 | 3 | 104 |
Photographer 15 | 9 | 104 |
Photographer 16 | 6 | 21 |
I made a sample file pbix with the data model. You can download it by Wetransfer: https://we.tl/t-O7jrYEiGTp (corrected version, so without a duplicate in the taglist)
All help is welcome,
Thank you very much!
Carla
Hi @Carla17 ,
Based on the sample and description you provided, Please try code as below to create a measure.
Number of shoots =
VAR _NUM1 = CALCULATE(
COUNTROWS('Shoots'),
FILTER('Shoots',
'Shoots'[Hospital] = MAX('Shoots'[Hospital]))
)
VAR _NUM2 = CALCULATE(
COUNTROWS('Shoots'),
ALLEXCEPT('Shoots','Shoots'[Photographer])
)
return IF(ISINSCOPE('Shoots'[Hospital]),_NUM1,_NUM2)
Result is as below.
Regarding your reference to Number of possible shoots, I'm not sure what calculations you are basing your prediction on. If this reply still does not help solve your problem, please feel free to ask us.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Yulia,
Thank you very much for replying to my post.
But unfortunally this is not what I was looking for.
I try to get the use case a little more clear.
eg for the datamodel:
So I would need a table:
Photographer | Numer of shoots done | Number of possible shoots |
Photographer 11 | 2 | 74 |
Do you think you can crack this for my?
Thank you very much,
Carla
@Carla17
There are duplicates in the Taglist, please check.
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Oh, I'm really sorry. You are 100% right. This is the corrected file: https://we.tl/t-CbrMSIDkjR. I double checked, this was the only duplicate.
Thank you very much for pointing this out to me. 🙏
.
User | Count |
---|---|
84 | |
80 | |
72 | |
71 | |
55 |
User | Count |
---|---|
108 | |
106 | |
93 | |
85 | |
67 |