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

DAX related

hello guys, 
i am new in power bi  and i am facing some issues in DAX (CALCULATE()  FUNCTION).

i had created one measure with the following dax query : -

sales =
    CALCULATE(
        SUMX(
        'Table 1',
        'Table 1'[quantity ]*'Table 1'[net price ]
    ),
     'Table 1'[brand] = "bagga buggy"
    )
i am getting this output : - 
push_1-1662112258650.png

 


so the issue is this : - 
when i am adding year column in my visualization the data is also filtered out through YEAR in addition with "table 1"[brand] = "bagga buggy"  (which i had mentioned in above dax query).

Since  "table 1"[brand] = "bagga buggy" Internally this should work like this "FILTER(ALL('TABLE 1'),'table 1'[brand] = "bagga buggy" ) " 

WITH "table 1"[brand] = "bagga buggy"                                        

push_3-1662112666606.png

 

  WITH  "FILTER(ALL('TABLE 1'),'table 1'[brand] = "bagga buggy" )" 

 

push_4-1662112696470.png

 

CAN ANY ONE HELP ? 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @push ,

Whether the "the total of this measure" you mean is a yellow label for the image:

vyangliumsft_0-1662446563223.png

Here are the steps you can follow:

1. Create measure.

Total =
var _table=SUMMARIZE('Table','Table'[Group],"Value",[Measure])
return
IF(
    HASONEVALUE('Table'[Group]),[Measure],SUMX(_table,[Value]))

2. Result:

vyangliumsft_1-1662446563224.png

If you need pbix, please click here.

DAX related.pbix

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @push ,

Whether the "the total of this measure" you mean is a yellow label for the image:

vyangliumsft_0-1662446563223.png

Here are the steps you can follow:

1. Create measure.

Total =
var _table=SUMMARIZE('Table','Table'[Group],"Value",[Measure])
return
IF(
    HASONEVALUE('Table'[Group]),[Measure],SUMX(_table,[Value]))

2. Result:

vyangliumsft_1-1662446563224.png

If you need pbix, please click here.

DAX related.pbix

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Tahreem24
Super User
Super User

@push Create this measure,

MEASURE = CALCULATE
                         (  SUM('Table 1'[quantity ])*SUM('Table 1'[net price ]),
                           FILTER(Table 1, 
'Table 1'[brand] = "bagga buggy")
                          )

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Thanks for your effort,
but the total of this measure

will be incorrent 

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.