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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
zwaters3
Helper I
Helper I

Removing header from graph causes data to disappear

Hello guys, Let me give you a brief rundown of the problem I am experiencing: 
Using a combination of measures and slicers, I've been able to create a system where a user can select two projects, their start and end dates, and then have them be graphed. Seen below is a screenshot of it in action: 
screenshot1screenshot1

 

But when I remove the Legend(which was simply the project's names), Something odd happens:
screenshot2screenshot2

 

all the data involving the Project A(dates 7/2/2020 - 7/5/2020). After experimenting with the data long enough - the table with the legend seemingly only shows data from Project C. Any of the other projects’ information is invisible/missing.  If I ever want to see my data again, adding back the legend seemingly fixes everything. What could be going on that causes this?

5 REPLIES 5
Greg_Deckler
Super User
Super User

@zwaters3 - To answer your question, would need to understand what you have in the Values area for that area chart. Is it a column or a measure? What is it's formula? What is the aggregation?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Another interesting tidbit I just discovered - there is data that can be shown in a table for the measure, and I can seemingly force the hidden data to appear by selecting the project name using a seperate slicer. 

Hidden Data:
screenshot 3-min.png

 


Selecting Project A with Seperate Slicer:
screenshot 4.png

 


Selecting Project B with Seperate Slicer:
screenshot 5.png

 


But something super odd happens when I select both project A and B with the Seperate Slicer, it defaults to whatever the "last most"(where C>B>A) project's time. 

Project B has the later dates this timeProject B has the later dates this time

 

Project B has the earlierdates this timeProject B has the earlierdates this time
 

hi @zwaters3 

Could you please share your sample pbix file for us have a test? that will be a great help.

You can upload it to OneDrive for business and post the link here. Do mask sensitive data before uploading.

 

Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I am using a measure as the value for the area chart - the formula itself is a bit ugly to parse but ill go for it anyways:


Meas-3 Curv =

// This is the variable of the project currently have the operation being performed on
VAR projectName = MAX([Name])

// This gets the minimum(start) and maximum(end) dates from the selection 1 date table
VAR Sel-S1 = CALCULATE(MIN('Daysheet Type-s1'[Numday]),ALLSELECTED('Daysheet Type-s1'))
VAR Sel-E1 = CALCULATE(MAX('Daysheet Type-s1'[Numday]),ALLSELECTED('Daysheet Type-s1'))

// This gets the minimum(start) and maximum(end) dates from the selection 2 date table
VAR-S2 = CALCULATE(MIN('Daysheet Type-s2'[Numday]),ALLSELECTED('Daysheet Type-s2'))
VAR-E2 = CALCULATE(MAX('Daysheet Type-s2'[Numday]),ALLSELECTED('Daysheet Type-s2'))

// Determine which one of the selectors has the project name chosen
VAR selectName1 = CALCULATE(MAX('I-Proj List1'[Name]),ALLSELECTED('I-Proj List1'))
VAR selectName2 = CALCULATE(MAX('I-Proj List2'[Name]),ALLSELECTED('I-Proj List2'))

// funnel variables that get the corosponding start and end dates that match the selector that have the matching project name 
VAR selectStart = IF(projectName = selectName1, Sel-S1, Sel-S2]
VAR selectEnd = IF(projectName = selectName1, Sel-E1, Sel-E2]

// this is the  math section, basically makes the data take a sort normal curve shape
VAR daysIntoProj = DATEDIFF(selectStart, MAX([Dates]) - 1, DAY)
VAR projectDuration = DATEDIFF(selectStart, selectEnd, DAY)
VAR z1 = (daysIntoProj - (projectDuration / 2) ) / ( (projectDuration / 2) / 3)
VAR z = SWITCH(TRUE(),
z1 <= -3, -3,
z1 >= 3, 3,
ROUND(z1,1))
VAR percentage =SWITCH(TRUE(),
z >= -3.9 && z <= -3.0, 0.10,
z >= -2.9 && z <= -2.0, 0.15,
z >= -1.9 && z <= -0.1, 0.20,
z >= 0.0 && z <= 1.4, 0.25,
z >= 1.5 && z <= 1.9, 0.20,
z >= 2.0 && z <= 3.0, 0.15,
z >= 3.1 && z <= 3.4, 0.10,
z >= 3.4 && z <= 3.9, 0.05)
VAR simpleAssignment = 6.5 * percentage

// This is the return block section, it basically NULLs out any data that appears before the start date, after the end date, or was from //                                                                                        a project not selected 
Var returnValue = simpleAssignment 
VAR tooEarlyDay = DATEDIFF(MAX([Dates]), selectStart, DAY)
VAR excessDay = DATEDIFF(selectEnd, MAX([Dates]), DAY)
VAR return_Prct_Excess_1 = IF(tooEarlyDay > 0, BLANK(), returnValue)
VAR return_Prct_Excess_2 = IF(excessDay > 0, BLANK(), return_Prct_Excess_1)
VAR return_Prct_Excess_3 = IF(projectName = selectName1 || projectName = selectName2, return_Prct_Excess_2, BLANK())
VAR final_Return = return_Prct_Excess_3
RETURN final_Return

My apologies for some of the bad formatting. The only sections that I would focus on would be the input and output sections, the actual math calculations can be ignored. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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