cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ManuApo
Helper I
Helper I

Struggling with a DAX measure :( Help!Help!Help!!

Hello community, 

I am struggling to create few measures with the same end point, hopefully someone can help me. 

I have a dimension calendar table with a relationship to my fact table. I have a date slicer that I use to filter my visuals. 

I want to create 4 measures based on 4 measures that I have already created where basically removes the date filter slicer but keeps the year i.e. in this case all rows for 2022 

Any suggestions??  

Attached is a screenshot:
InkedScreenshot 2022-01-17 133236_LI.jpg


1 ACCEPTED SOLUTION

Hi @ALLUREAN and @amitchandak 

this is not working.  But I finally got it working doing this!!!!

Measure 1 =

VAR THISYEAR = YEAR(MAX(Dim_Calendar[FullDateAlternateKey]))
RETURN
CALCULATE( SUM('Fact'[GNWP]), ALLCROSSFILTERED(Dim_Calendar), Dim_Calendar[Year] = THISYEAR)

I dont know how I did it, but it is just working...
Many thanks again

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@ManuApo ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.



New Power BI Features
Datamarts: https://youtu.be/8tskWsJTEpg
Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin !! Proud to be a Super User!
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
!! Subscribe to my youtube Channel !!

Hi @amitchandak , 

The date slicer on top of the screenshot (where it says period) ,  is filtering the 4 measures that are on the table. That is giving me the desired results.

On the other hand I want to create 4 new measures that removes the filter used in the slicer (

Dim_Calendar[FullDateAlternateKey]),   but filters the year used on the slicer. It basically to create a year summary.


It must be something like this....

Measure 1 =
       CALCULATE( SUM('Fact'[GNWP]) ,  

                            FILTER(Dim_Calendar, Dim_Calendar[FullDateAlternateKey].[Year])
                           )

 

Hope it makes it more clear now, 
Thank you so much!!
Manu
 

Hi, @ManuApo 
Try this:

Measure 1 =
       CALCULATE( SUM('Fact'[GNWP]) ,  

                           ALL(Dim_Calendar[Year])
                           )



Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Hi @ALLUREAN and @amitchandak 

this is not working.  But I finally got it working doing this!!!!

Measure 1 =

VAR THISYEAR = YEAR(MAX(Dim_Calendar[FullDateAlternateKey]))
RETURN
CALCULATE( SUM('Fact'[GNWP]), ALLCROSSFILTERED(Dim_Calendar), Dim_Calendar[Year] = THISYEAR)

I dont know how I did it, but it is just working...
Many thanks again

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors