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
kageyoshi777
Frequent Visitor

Different value after using legen/details in visual

I have one data table that grows with new data every week. This is real estate market data, so the snapshot occurs weekly, the same advert_number will often appear in the data however with a different data download_date.

 

In several visualizations, I want to show the number of bids that changes under different filters, however, the metric is always to show the number of bids equal to the maximum day in the entire table.

 

#2#CountAdvertMaxData =
CALCULATE (
    COUNT ( estate_data[advert_number] ),
    FILTER (
        ALL ( estate_data[date_download] ),
        estate_data[date_download] = MAX ( estate_data[date_download] )
    )
)

After putting on a few filters, I was able to filter out 8 records. The metrics show this number well, as does the pie chart when there is no legend. When the legend is added it shows values that are not clear where they come from.

 

 

Bez tytułu.png

 

The chart behaves as if it does not take the maximum date into account.

After adding an additional date slicer and manually selecting the latest date, the chart shows the correct data.

Any ideas why it behave's like this?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@kageyoshi777 , Try like

 

#2#CountAdvertMaxData =
Var _max = MAXX(ALL ( estate_data[date_download] ), estate_data[date_download] )
return
CALCULATE (
COUNT ( estate_data[advert_number] ),
FILTER (
ALL ( estate_data[date_download] ),
estate_data[date_download] = _max
)
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@kageyoshi777 , Try like

 

#2#CountAdvertMaxData =
Var _max = MAXX(ALL ( estate_data[date_download] ), estate_data[date_download] )
return
CALCULATE (
COUNT ( estate_data[advert_number] ),
FILTER (
ALL ( estate_data[date_download] ),
estate_data[date_download] = _max
)
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

perfect! Thank you very much.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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