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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
cerebro
Helper I
Helper I

Raw Power Query Table as Visual

Dear community,

 

I have a perfect query where column names are dynamic dates and the order is descending except for the total line

bhohpi.PNG

In the desktop version of power bi as a matrix or table visual it messes everything up, the order of the lines is wrong, the column names change every week so that a have to rebuild this visual every week with new column names:

bhohpi1.PNG

 bhohpi2.PNG

 

is there any way of displaying the whole table from power query in a desktop report ? No matrix and no table visual, just raw data?

 

Thank you in advance!

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @cerebro ,

 

Here are the steps you can follow:

1. Select [2024.10.13], [2024.10.6], [2024.10.20],[%week] -- Transform – Unpivot Columns.

vyangliumsft_0-1730187802181.png

2. Add Column – Custom Column – enter code.

if [Attribute] = "%week" then null else [Attribute]

vyangliumsft_1-1730187802191.png3. Select [Custom] – Change Type – Date Time

vyangliumsft_2-1730187827507.png

4. Select [Custom] – Display the specified Format

vyangliumsft_3-1730187827509.png

5. Create calculated column.

Rank =
IF(
    [Custom]=BLANK(),0,
RANKX(
    'True_Table',[Custom],,DESC,Dense))

vyangliumsft_4-1730187843720.png

6. Create measure.

Measure =
IF(
    MAX('True_Table'[Rank])<=2,SUM('True_Table'[Value]),BLANK())

vyangliumsft_5-1730187843721.png

7. Result:

vyangliumsft_6-1730187884248.png

 

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

4 REPLIES 4
Anonymous
Not applicable

Hi  @cerebro ,

 

Here are the steps you can follow:

1. Select [2024.10.13], [2024.10.6], [2024.10.20],[%week] -- Transform – Unpivot Columns.

vyangliumsft_0-1730187802181.png

2. Add Column – Custom Column – enter code.

if [Attribute] = "%week" then null else [Attribute]

vyangliumsft_1-1730187802191.png3. Select [Custom] – Change Type – Date Time

vyangliumsft_2-1730187827507.png

4. Select [Custom] – Display the specified Format

vyangliumsft_3-1730187827509.png

5. Create calculated column.

Rank =
IF(
    [Custom]=BLANK(),0,
RANKX(
    'True_Table',[Custom],,DESC,Dense))

vyangliumsft_4-1730187843720.png

6. Create measure.

Measure =
IF(
    MAX('True_Table'[Rank])<=2,SUM('True_Table'[Value]),BLANK())

vyangliumsft_5-1730187843721.png

7. Result:

vyangliumsft_6-1730187884248.png

 

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

 

many thanks, that works!

Anonymous
Not applicable

Hi  @cerebro ,

 

As far as I know, Power BI Desktop sorts by default in alphabetical order. You can try setting an index in Power Query and sort the [Category] according to the index.

In Power Query -- Add Column – Index Column – From 1

vyangliumsft_0-1729130955002.png

Select – [Category] – Column tools – Sort by column – [Index]

vyangliumsft_1-1729130955005.png

Result:

vyangliumsft_2-1729130962631.png

 

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.

thank you very much for the hint with the indexing.

Do you have an idea how to solve my other problem, that the column names change every week, this week the columns are "2024.10.13" and "2024.10.20" and i have to build up the matrix visual every week once again, because the column "2024.10.6" will not be found anymore (dynamically two last weeks).

Thank you again.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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