Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
CTan42
Helper II
Helper II

same measure in every pages

Hi all, I have 5 tables (e.g. Table A, Table B, Table C, Table D, Table E). Below is the measure which i want to do:

1. CurrentMonth = sum('Table A'[Revenue])

2. CurrentMonth = sum('Table B'[Revenue])

3. CurrentMonth = sum('Table C'[Revenue])

4. CurrentMonth = sum('Table D'[Revenue])

5. CurrentMonth = sum('Table E'[Revenue])

 

So my problem here is i have to do that measure in every tables. Howevery the power bi doesn't allow me to using the same measure name. Due to the presentation purpose, I'm suggest to use 'current month' as the column name. So, is there any other ways to fix it? Thanks.

 

Regards,

Chung. 

6 REPLIES 6
cs_skit
Resolver IV
Resolver IV

You don't need the measure in TableA, B, C, D and E if you do a SUM over all and filter according to your relations like with a slicer.

 

You could even do a slicer on fixed values A/B/C/D/E if you really really need it the way you said. 

 

Measures are not really stored in tables that is just for visual/order purposes. The context of the measure and like which tables it references is defined only by the DAX.

Just place it in TableA or wherever seems best and you can use it anywhere.

Thanks for the suggestion. However I dont really understand what you are saying. But the reason why i need to do the measure is I have to make a matrix table at the end with using the measure as the value in the matrix table. Or could show me the instruction?

Thanks

Hi @CTan42,

As the @cs_skit said, you can create a disconnected table as follows. Create a slicer including [TableName].

1.PNG

Then create a measure using the formula.

CurrentMonth = SWITCH(CALCULATE(FIRSTNONBLANK(NewTable[TableName],NewTable[TableName]),ALLSELECTED(NewTable)),
                      "A", sum('Table A'[Revenue]),
                      "B", sum('Table B'[Revenue]),
                      "C", sum('Table C'[Revenue]),
                      "D", sum('Table D'[Revenue]),
                      "E", sum('Table E'[Revenue]), 
)


When you select "A" in slicer, it will calculate the sum('Table A'[Revenue]), when you select "B", it will calculate sum('Table B'[Revenue]) and so on.

More details, please review this article.

Best Regards,
Angelia

 

@v-huizhn-msft thanks for the suggestion. However, my data is complicated. The reason why I do this measure is i have to use this measure into another measure. Below are my full measure for 1 table:

1. CurrentMonth = SUM('A'[Revenue])

2. PreviousMonth = CALCULATE('A'[CurrentMonth], PREVIOUSMONTH('A'[Date]))

3. LastYearMonth = CALCULATE('A'[CurrentMonth], SAMEPERIODLASTYEAR('A'[Date]))

4. CurrentMonth/PreviousMonth = 'A'[CurrentMonth] - 'A'[PreviousMonth]

5. CurrentMonth/LastYearMonth = 'A'[CurrentMonth] - 'A'[LastYearMonth]

 

As power bi doesnt allow me use the same measure name, so atm i using different measure name in every table (eg. A<CurrentMonth>, B<CurrentMonth>).  What I hope to do is just have all measure are having the same name. Is there anyway to make it better?

 

thanks.

Hi @CTan42,

Unfortunately, we are unable to use the same name for different measures. Usually, we can not recognize each measure's calculation if they have same name.

Best Regards,
Angelia

Maybe if you post your tables and what you need peoples can propose a solution.

 

Btw if its the same data structure in those tables you might want to merge them. Either in Query Editor or by New Table DAX

 

NewTableName =

UNION(

TableA; TableB; TableC; TableD; TableE

)

 

What you want in your original question is impossible each measure has to have unique name. But ihmo its the wrong question there is probably a better solution for your problem then what you want to do in your first post.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors