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
csaethre19
Helper II
Helper II

Data for Measure Changes when Legend is Set

I am using measures to calculate a failure rate and display it on a line chart. I want this line chart to have its legend set by a field called failure mode. The two measures I have to calculate the failure rate measure are:

 

Measure_FailureCount = COUNT('public failure'[Failure Mode])
and
 
Measure_TotalRuns =
CALCULATE(
    DISTINCTCOUNT('public failure'[experimentId]),
    REMOVEFILTERS('public failureMode'[Failure Type], 'public failureMode'[Designation])
)
 
When I do not have the legend set to failure mode, I get correct (accumulative) failure rates for each day. 
When I set the legend to failure mode I expect that it will calculate per failure mode the failure rate per day based on the total runs measure for that day.
 
However, it appears that when the legend is set, the total runs changes and I get inaccurate failure rates per failure mode.
I am wondering why does this happen and how can I fix this?
 
 
csaethre19_0-1686016426824.png

The first data point in this line chart should be 20%, etc.

 

The following link is to a .pbix file that has a sample report/data that shows what I am talking about:

https://drive.google.com/file/d/10tOYSEt6w-_WfEBi6L-oaamE1il9c6ws/view?usp=sharing 

2 REPLIES 2
amitchandak
Super User
Super User

@csaethre19 , when you use legend and still you want cumulative to work. You shlould use date table in measure , visual and slicer

 

example

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date])))

Cumm Based on Date = CALCULATE([Net], Window(1,ABS,0,REL, ALL('date'[date]),ORDERBY('Date'[date],ASC)))

Cumm Based on Date = CALCULATE([Net], Window(1,ABS,0,REL, ALLSELECTED('date'[date]),ORDERBY('Date'[date],ASC)))

Running Total/ Cumulative:
https://www.youtube.com/watch?v=h2wsO332LUo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=42

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Thank you for the provided resources. After watching the videos I am still not sure that the extra date table is making a difference. I went ahead and added a separate date table as instructed in the second video. I made a relationship (1-to-many) between the date table and my fact table. I set the x-axis in my visual to use the date table instead of the experiment start time field in my fact table. I am not seeing any difference in the way this graph behaves when the legend is set.

 

I have provided a link to my updated .pbix file if you are able to take a look.

https://drive.google.com/file/d/1jHBs-DYAyATDpbytLeNM8If0XIg_ZqUZ/view?usp=sharing 

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.