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
Clout
Helper III
Helper III

Make a measure only dependent from the year

Hello guys, I have two measures with the same function which I want to visualise in a card:

 

JSM_21d = DIVIDE(SUM('Flow'[AK_QT_d_21d]), COUNT('Flow'[AK_QT_d_21d])) * 365))
 
But I want that the outcome of this measure is only dependent of the year, and should not be calculated for every day because it only makes sense if I look at the whole year.
 
So I want to show in a card the year which is part of the date and the two measures.  As you can see in the table the measures are filtered by the year and its giving me the right values. But if I visualise it in the cards, the measures arent filtering only for the year and its giving me the wrong value.
 
erste.PNG
And this is how it looks when I choosed the whole date of my data:
 
zweite.PNG
So I wantto , that the cards are behaving like the table in the picture.
 
Thanks in advance!
 
 
1 ACCEPTED SOLUTION

Thank you for your suggestion @amitchandak.

 

I solved it now with a calculated column instead of a measure with the same DAX function and then I put the calculated column as a average in the card visual.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Clout , I had a doubt that there is no interaction between the card and the date slicer. Or Card measure uses all(Date)

can you check these two

https://docs.microsoft.com/en-us/power-bi/service-reports-visual-interactions

Hello @amitchandak, sry I gave the wrong measure.

My measure is this:

 

JSM_21d = CALCULATE(DIVIDE(SUM('Flow'[AK_QT_d_21d]), COUNT('Flow'[AK_QT_d_21d])) * 365, ALLEXCEPT(Datum, Datum[Jahr]))
 
And when I use this measure it looks like the picture above because only the year is filtered.
 
And if I use the measure above in my first post, the measure is calculated for every time invervall. But I only want, that it changes when the time intervall is in a different year.

@Clout , this will allow filtering Datum[Jahr]

 

refer

https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept...

https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Thank you for your suggestion @amitchandak.

 

I solved it now with a calculated column instead of a measure with the same DAX function and then I put the calculated column as a average in the card visual.

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.