Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
POSPOS
Helper V
Helper V

How to show summarized data dynamically

Hi all,

I have a requirement to show summary level data in a dot/scatter chat.

Below is the sample data format I have.

POSPOS_0-1706564114372.png

I have represented the data in Power BI as below: Sample file attached pbix

POSPOS_1-1706564165056.png

Days for phase 1/phase 2/phase 3 are the days between the two dates shown in median.

Now, I want to get the data in the below format to represent as a plot/scatter chart. This should be dynamic and the values should change based on the slicer selection.

POSPOS_0-1706566554688.png

 

Requirement is to show as Scatter chart:

POSPOS_0-1706566694278.png

 

 

Can someone please let me know how to achieve this in DAX (not M Query) as this is a sample data from the huge data set that is being used.

 

Thank you.

 

 

2 ACCEPTED SOLUTIONS

@POSPOS 

output : 

Daniel29195_0-1706567727483.png

 

check solution below :

 

step 1 : 

create a config table : 

Daniel29195_1-1706567750709.png

 

step 2 : 

create the following measures : 

phase 1 = 
SUMX(
    scatter,
    DATEDIFF(scatter[start date] , scatter[step1] , day)
)



phase 2 = 
SUMX(
    scatter,
    DATEDIFF(scatter[step1] , scatter[step2] , day)
)



phase 3 = 
SUMX(
    scatter,
    DATEDIFF(scatter[step2] , scatter[final date] , day)
)





all phases = 
SWITCH(
    TRUE(),
    SELECTEDVALUE(config_tbl[days_for]) = "days for phase 1" ,[phase 1],
    SELECTEDVALUE(config_tbl[days_for]) = "days for phase 2" ,[phase 2],
    SELECTEDVALUE(config_tbl[days_for]) = "days for phase 3" ,[phase 3]
)

 

\

 

last step : 

drag and drop to the visual :

Daniel29195_2-1706567827838.png

 

 

output : 

Daniel29195_3-1706567849404.png

 

 

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution !
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

 

View solution in original post

@POSPOS 

 

change your code as below :check image .

 

Daniel29195_0-1706570179323.png

 

 

 

 

View solution in original post

7 REPLIES 7
POSPOS
Helper V
Helper V

@Daniel29195 
I want to achieve a summary level information as below to represent this information in a scatter chart.

These values should also change based on the slicer selection made. 

POSPOS_0-1706566388455.png

 

@POSPOS 

output : 

Daniel29195_0-1706567727483.png

 

check solution below :

 

step 1 : 

create a config table : 

Daniel29195_1-1706567750709.png

 

step 2 : 

create the following measures : 

phase 1 = 
SUMX(
    scatter,
    DATEDIFF(scatter[start date] , scatter[step1] , day)
)



phase 2 = 
SUMX(
    scatter,
    DATEDIFF(scatter[step1] , scatter[step2] , day)
)



phase 3 = 
SUMX(
    scatter,
    DATEDIFF(scatter[step2] , scatter[final date] , day)
)





all phases = 
SWITCH(
    TRUE(),
    SELECTEDVALUE(config_tbl[days_for]) = "days for phase 1" ,[phase 1],
    SELECTEDVALUE(config_tbl[days_for]) = "days for phase 2" ,[phase 2],
    SELECTEDVALUE(config_tbl[days_for]) = "days for phase 3" ,[phase 3]
)

 

\

 

last step : 

drag and drop to the visual :

Daniel29195_2-1706567827838.png

 

 

output : 

Daniel29195_3-1706567849404.png

 

 

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution !
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

 

@Daniel29195 
After testing the solution provided, I noticed that the values are not showing up correctly when all the values are selected.
Expected result when all the values are slected is 
Days for phase 1 = 1
Fays for phase 2 = blank
Days for phase 3 = 37

But we are only getting only Days for phase 1 = 1. I have attached the pbix file with the solution provided here

POSPOS_0-1706568740359.png
Could you please check this and suggest

 

@POSPOS 

 

change your code as below :check image .

 

Daniel29195_0-1706570179323.png

 

 

 

 

@Daniel29195  - Thnak you so much for the quick response.
solution worked perfectly!

@POSPOS 

i got you now.

one moment i will send you the solution .

 

best regards,

Daniel29195
Super User
Super User

@POSPOS 

 

can you please rephrase what you want to achieve ?  i didnt quite fully understand like what the DAX code should do ? 

 

best regards,

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.