The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi guys!
I'm struggling with something that seems to be pretty easy. I have a model consisting of 2 tables: projects and updates. I have created a calculated table for Dates too, but it isn't connected to the other tables. Here the detail of the tables:
Date =
ADDCOLUMNS(
CALENDAR(
DATE(YEAR(MIN('Updates'[Created])),1,1),
DATE(YEAR(MAX('Updates'[Created])),12,31)
),
"Year", YEAR([Date]),
"Month", FORMAT([Date], "mmmm"),
"Month Number", MONTH([Date])
)
Active relationship is Projects[Key] 1:* Updates[Key].
My goal is to display two things:
I would like that both visuals were connected so when I select a bubble of the scatter plot, the table only displays the projects with the corresponding "Current status".
Thank you in advance.
Here is the PBIX: click here.
Best regards,
Fernando
Solved! Go to Solution.
Hi @Anonymous ,
Please update the measure1 to
Measure1 =
VAR a =
SUMMARIZE (
'Updates',
'Updates'[Key],
"lastdate",
CALCULATE (
MAX('Updates'[Created]),
FILTER ( 'Updates', 'Updates'[Created] <= MAX('Date'[Date] ))
)
)
VAR b =
ADDCOLUMNS (
a,
"laststatus",
CALCULATE (
MAX ( 'Updates'[Status] ),
FILTER ( ALL('Updates'), 'Updates'[Created] = EARLIER ( [lastdate] )&&'Updates'[Key] = EARLIER('Updates'[Key]) )
),
"lastphase",
CALCULATE (
MAX ( 'Updates'[Phase] ),
FILTER (ALL('Updates'), 'Updates'[Created] = EARLIER ( [lastdate] )&&'Updates'[Key] = EARLIER('Updates'[Key]) )
),
"lastcomments",
CALCULATE (
MAX ( 'Updates'[Comments] ),
FILTER ( ALL('Updates'), 'Updates'[Created] = EARLIER ( [lastdate] )&&'Updates'[Key] = EARLIER('Updates'[Key]) )
),
"last next steps",
CALCULATE (
MAX ( 'Updates'[Next steps] ),
FILTER ( ALL('Updates'), 'Updates'[Created] = EARLIER ( [lastdate] )&&'Updates'[Key] = EARLIER('Updates'[Key]) )
)
)
RETURN
CALCULATE(DISTINCTCOUNT('Updates'[Key]),FILTER(b,[lastphase] = MAX('Phases'[Phase])))
Then use the 'Phases'[Phase] as x-axis in scatter plot, then you can get what you need.
For more details, please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/Ed_t1idp5TVPgelkiB5mmhQBL5fz8B5T4Vm-6cxjM2Qqdg?e=3pYdNw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @Anonymous ,
Please update the measure1 to
Measure1 =
VAR a =
SUMMARIZE (
'Updates',
'Updates'[Key],
"lastdate",
CALCULATE (
MAX('Updates'[Created]),
FILTER ( 'Updates', 'Updates'[Created] <= MAX('Date'[Date] ))
)
)
VAR b =
ADDCOLUMNS (
a,
"laststatus",
CALCULATE (
MAX ( 'Updates'[Status] ),
FILTER ( ALL('Updates'), 'Updates'[Created] = EARLIER ( [lastdate] )&&'Updates'[Key] = EARLIER('Updates'[Key]) )
),
"lastphase",
CALCULATE (
MAX ( 'Updates'[Phase] ),
FILTER (ALL('Updates'), 'Updates'[Created] = EARLIER ( [lastdate] )&&'Updates'[Key] = EARLIER('Updates'[Key]) )
),
"lastcomments",
CALCULATE (
MAX ( 'Updates'[Comments] ),
FILTER ( ALL('Updates'), 'Updates'[Created] = EARLIER ( [lastdate] )&&'Updates'[Key] = EARLIER('Updates'[Key]) )
),
"last next steps",
CALCULATE (
MAX ( 'Updates'[Next steps] ),
FILTER ( ALL('Updates'), 'Updates'[Created] = EARLIER ( [lastdate] )&&'Updates'[Key] = EARLIER('Updates'[Key]) )
)
)
RETURN
CALCULATE(DISTINCTCOUNT('Updates'[Key]),FILTER(b,[lastphase] = MAX('Phases'[Phase])))
Then use the 'Phases'[Phase] as x-axis in scatter plot, then you can get what you need.
For more details, please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/Ed_t1idp5TVPgelkiB5mmhQBL5fz8B5T4Vm-6cxjM2Qqdg?e=3pYdNw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @v-deddai1-msft!
Thanks for your help :). I've checked and it's close to what I was looking for. The table is showing the latest status, phase, comments and next steps for each project. However, the scatter plot is not working properly since it should show the aggregation of the table (only one count per project, that is, maximum of 5 as result of summing all the counts by phase, since there are 5 projects). For example, as of May 8th 2020 there should be 2 projects in POC and 1 in deployment. How could I get this result in the scatter plot? Here the latest PBIX.
Thank you in advance.
Best regards,
Fernando
Hi @Anonymous ,
I have edit the reply, please try again.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @Anonymous ,
Would you please refer to the following measure:
measure for scatter plot:
Measure1 =
VAR a =
SUMMARIZE (
'Updates',
'Updates'[Key],
"lastdate",
CALCULATE (
LASTNONBLANK ( 'Updates'[Created], 1 ),
FILTER ( 'Updates', 'Updates'[Created] IN VALUES ( 'Date'[Date] ) )
)
)
VAR b =
ADDCOLUMNS (
a,
"laststatus",
CALCULATE (
MAX ( 'Updates'[Status] ),
FILTER ( 'Updates', 'Updates'[Created] = EARLIER ( [lastdate] ) )
)
)
RETURN
COUNTX (
FILTER ( b, [laststatus] = MAX ( 'Updates'[Status] ) ),
'Updates'[Key]
)
As other measures are quite long, I suggest you refer to PBIX directly: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EQHPBZZB0ehHvQdCvo76TPwBJgr5PX7_kN5qvX13l3MrIg?e=3FYPAz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi Dedmon!
Thank you for your reply.
I've download the PBIX to see the measures, but it seems to be the original PBIX with only the star schema. May you share the wrong PBIX?
Thank you in advance.
Best regards,
Fernando