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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
nishad1092
Helper III
Helper III

Need help with a small export csv from this power bi data table

Hi Team, 

 

I just want to know how do I create a table in power bi or a graph, wherein I should be able to export the data as CSV. 

 

Expected Output:

I want the exported CSV to have these column:

 

Meter ID (Meter_identifier)New Meter Reading (newMeteredQuantity)Previous Meter Reading (previousMeteredQuantity)
KM1012000
KM1021000
KM2011000

 

Formula:

KM101: Monthly sum of _value + _value_b

KM102: Monhtly sum of _value

KM201: Monthly sum of _value_b

 

New_Meter Reading: Shows the monthly values. 

Previous Meter reading: Shows 0 by default

 

The excel data which is the source is attached here:

sample_Data.csv

sample data 

 

How do I create a measure to display it in the table in the PowerBi so as to export it as csv. ?

 

 

6 REPLIES 6
v-rongtiep-msft
Community Support
Community Support

Hi @nishad1092 ,

Exporting data from a report visual in Power BI Desktop is straightforward. When you export the data, Power BI creates a .csv file with the data.

  1. Select the visual, select More options (...) > Export data.
  2. In the Save As dialog box, select a location for the .csv file, and edit the file name, if you want.
  3. Select Save.

Create measures like the following:

K101_M =
CALCULATE (
    SUM ( Tabelle1[_value] ),
    FILTER (
        Tabelle1,
        Tabelle1[month] = SELECTEDVALUE ( Tabelle1[month] )
            && Tabelle1[year] = SELECTEDVALUE ( Tabelle1[year] )
    )
)

 

vrongtiepmsft_0-1705541284094.png

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

 

 

 

Hi 

 

Thank you so much. 
I'm trying to implement your solution. 

But is there a way to bring the KM values to the left; I want the CSV as the following:

 

Meter ID (Meter_identifier)New Meter Reading (newMeteredQuantity)Previous Meter Reading (previousMeteredQuantity)
KM1012000
KM1021000
KM2011000

 

I want the values "KM101, KM102, KM201" to be listed under Meter ID column. Please make changes to the table as well. I will implement it.

 

Hi @nishad1092 ,

I'm sorry I forgot to share the link to the relevant document. I have added it at the end of the reply. I have exported table visual so that it can be displayed in the order of "KM101, KM102, KM201".

 

Export data from a Power BI visualization - Power BI | Microsoft Learn

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

Hi, 

 

I exported the CSV from the pbix you shared.

nishad1092_0-1705584475164.png


 How do I get the exported CSV with the KM101, KM102... Values as rows.

nishad1092_1-1705584535025.png

 

Hi@  @nishad1092 ,

You can create a visual  like the one you want  and then export it.

Exporting data from a report visual in Power BI Desktop is straightforward. When you export the data, Power BI creates a .csv file with the data.

  1. Select the visual, select More options (...) > Export data.
  2. In the Save As dialog box, select a location for the .csv file, and edit the file name, if you want.
  3. Select Save.

Solved: Excel Export - Data with Current layout option is ... - Microsoft Fabric Community

 

Best Regards
Community Support Team _ Rongtie

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

Hi @v-rongtiep-msft 

Thank you for your guidance, 

What I meant by the previous reply is:  How do I get the expected CSV with the below data:

nishad1092_0-1705667612115.png



Because When I export CSV using your solution, I get the KM values as separate columns, I need that KM values as the row itself under column name 'Meter ID' and then the corresponding KM values would be monthly values (calculated as per the KMs equation which I mentioned in the post)

 

Expected output:
I need a table or matrix (later I want the CSV data), 

the new table will be:

 

Meter ID will have three rows KM101, KM102, KM201:

 

KM101 result is: SUM of Monthly wise data of _value + _value_b

KM102 result is: SUM of Monthly wise data of _value

KM201 result is: SUM of Month wise data of _value_b

So far I got this matrix:

nishad1092_1-1705670640608.png



But when I export as CSV, its all messy, and also column name I can't get it as MeterID.



Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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