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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Dynamically changing data types in line chart

Hi all,

 

I have a matrix that has different data types in rows. For example, some rows are int, some percentages, some currency, etc. 

SakoKassabian_0-1681426695863.png

 

I have a line chart that displays the previous 52 weeks of data on the same page and I'd like it to show the correct data type that the user clicks on from the matrix. Right now, whatever line the user clicks on, it defaults to a decimal data type. I created a few cards to make sure my logic is correct and so far seems fine. Here is the dax measure I currently have on the line chart. I understand that it's not the cleanest and can be refactored, but just trying to get something working right now. Selected Value Type = SelectedValue(value type of matrix line)

 

 

 

 

Rolling 52 Week Value = If([Selected Value Type] == BLANK(), "",
                            IF(SUM('Daily Fact Metric'[YtdMeasure]) == Blank() && [Selected Value Type] == "decimal", SUM('Daily Fact Metric'[MetricMeasure]),
                                IF(SUM('Daily Fact Metric'[YtdMeasure]) == Blank() && [Selected Value Type] == "int", SUM('Daily Fact Metric'[MetricMeasureInt]),
                                    IF(SUM('Daily Fact Metric'[YtdMeasure]) == Blank() && [Selected Value Type] == "money", SUM('Daily Fact Metric'[MetricMeasureCurrency]),
                                        IF(SUM('Daily Fact Metric'[YtdMeasure]) == Blank() && [Selected Value Type] == "percent", SUM('Daily Fact Metric'[MetricMeasurePercent]),
                                            SUM('Daily Fact Metric'[YtdMeasure]))))))

 

 

 

 

3 REPLIES 3
lbendlin
Super User
Super User

Please check the new measure formatting options in the April 2023 Power BI Desktop version.

Anonymous
Not applicable

Thank you. I did and nothing changed 😞

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors