Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi,
I would like to create a Treasury yield curve in PowerBI like the one on the left in this app I found online. https://app.powerbi.com/view?r=eyJrIjoiZDc1ZGFhYzItZWIyYy00N2UyLTg0YzgtMGViYWEyYzZhMDQ3IiwidCI6IjRhY...
Data looks like this: https://home.treasury.gov/resource-center/data-chart-center/interest-rates/TextView?type=daily_treas...
I would like to know how to make the curve for one day, so I do the same for the rest. I tried to create measures, but I got error messages saying that I couldn't display more than one value in a measure. If I create a table for each date I want, I can't create the chart. Plus, creating tables is not dynamic.
Thanks!
Solved! Go to Solution.
Hi @AndreeaV ,
If you want to create line charts as the app in the link, I think you need to transform your underlying data by UNPIVOT function.
Select [Date] column and use UNPIVOT other columns. New table should look like as below.
Measure:
Most Recent =
VAR _Recent_Date = CALCULATE(MAX('Table'[Date]),ALL('Table'))
RETURN
CALCULATE(SUM('Table'[Value]),'Table'[Date] = _Recent_Date)Week Ago =
VAR _Recent_Date = CALCULATE(MAX('Table'[Date]),ALL('Table'))
return
CALCULATE(SUM('Table'[Value]),'Table'[Date] = _Recent_Date - 7)Month Ago =
VAR _Recent_Date = CALCULATE(MAX('Table'[Date]),ALL('Table'))
return
CALCULATE(SUM('Table'[Value]),'Table'[Date] = _Recent_Date - DAY(EOMONTH(_Recent_Date,-1)))
...
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks @Anonymous !
Hi @AndreeaV ,
If you want to create line charts as the app in the link, I think you need to transform your underlying data by UNPIVOT function.
Select [Date] column and use UNPIVOT other columns. New table should look like as below.
Measure:
Most Recent =
VAR _Recent_Date = CALCULATE(MAX('Table'[Date]),ALL('Table'))
RETURN
CALCULATE(SUM('Table'[Value]),'Table'[Date] = _Recent_Date)Week Ago =
VAR _Recent_Date = CALCULATE(MAX('Table'[Date]),ALL('Table'))
return
CALCULATE(SUM('Table'[Value]),'Table'[Date] = _Recent_Date - 7)Month Ago =
VAR _Recent_Date = CALCULATE(MAX('Table'[Date]),ALL('Table'))
return
CALCULATE(SUM('Table'[Value]),'Table'[Date] = _Recent_Date - DAY(EOMONTH(_Recent_Date,-1)))
...
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 55 | |
| 34 | |
| 32 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 75 | |
| 72 | |
| 38 | |
| 35 | |
| 25 |