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
Anonymous
Not applicable

Need to return latest value in a column chart

Hello everyone,

 

I have a table sample as follows

idDateOld ValueNew Value
101-01-2020 Step 1
101-02-2020Step 1Step 2
101-03-2020Step 2Step 3
201-04-2020 step 1
201-05-2020Step 1Step 2

 

I want to create a column chart where :

  • axis = [Date]
  • and column values = count of each [New value] value
  • and it should keep the latest value for each id; for example in '01-05-2020' i should have 1 "Step 2" and 1 "Step 3"

I was told that the EARLIER function could help but I don't know how it works.

 

Thanks in advance 🙂

1 ACCEPTED SOLUTION

Hi @Anonymous ,

Please review the content in the following links and check whether the custom visual Gantt is what you want. 

GANTT chart visuals in Power BI

Power BI Custom Visuals - Gantt

yingyinr_0-1633686432937.png

Best Regards

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

View solution in original post

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

Could you clearly show the expected result in a Table format.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

idnew valueDate
1Step 3>=01-03-2020
1Step 2>= 01-02-2020
and <01-03-2020
1Step 1>=01-01-2020
and < 01-02-2020

Hi @Anonymous ,

Please review the content in the following links and check whether the custom visual Gantt is what you want. 

GANTT chart visuals in Power BI

Power BI Custom Visuals - Gantt

yingyinr_0-1633686432937.png

Best Regards

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

Hi @Anonymous 

 

Take a look at my example below:

JDIBC_0-1633471610821.png

The logic is grouping the IDs and taking the max string from the field 'Old Value'. The process is duplicated for 'New Value'. I then went ahead and applied a value for each 'Step'.

JDIBC_1-1633471744210.png

This is the graph when using the new values.

JDIBC_2-1633471827774.png

Hope this helps and please leave a thumbs if it works!

 

-JID

Anonymous
Not applicable

The 3 steps was just to simplify the process but in reality I have 7. I don't want to create a new column for each one ..

Anonymous
Not applicable

@Anonymous Im not sure what you mean when you say "The 3 steps was just to simplify the process but in reality I have 7." Below i have an example with "Step 1" - "Step 7". You do not need to add new columns, just update the SWITCH DAX to include all steps.

 

JDIBC_0-1633530298729.pngJDIBC_1-1633530327475.png

 

Anonymous
Not applicable

Another problem ; what will the graph show in Jan 16th ?

Anonymous
Not applicable

The graph will display the highest "Old" and "New" value per ID.

StefanoGrimaldi
Resident Rockstar
Resident Rockstar

some documentation that could help for this: https://docs.microsoft.com/en-us/dax/earlier-function-dax

hope it helps you working around the formula you looking for 





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




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.