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
win_anthony
Resolver III
Resolver III

Data Export to Excel Not Correct

The goal is to export data which has a ratio. Problem is that the visual will correctly display the ratio but when exported, excel will generate the value as a date. The measure creating this ratio was formatted to be used as a KPI. The column's format for the exported data = "Custom". I tried playing around with the format by changing it to "General / Number / Text" but that did not resolve the issue. For context, below you will find the following: Ratio Measure /  Current Output / Expected Output

 

Not sure on how to remedy this but your advice is greatly appreciated.

 

Ratio Measure

 

sold_inventory_ratio =
IF( 
    TRUE()
    ,FORMAT([item_sold],"0,0") & " / " & FORMAT([item_inventory],"0,0")
    // ,FORMAT(VALUE([item_sold]),"0,0") & " / " & FORMAT(VALUE([item_inventory]),"0,0")
    // -- I also tried the above commented measure with FORMAT + VALUE but it was giving me the same output when exporting this ratio
    , 1
)

 

 

Current Output: Notice column [sold_inventory_ratio] >> Some values are ratios but some are listed as dates which is not correct

item_iditemitem_solditem_inventorysold_inventory_ratio
1Pizza155415 / 54
2Burgers548May-48
3Tacos1246Dec-46
4Sushi145Jan-45
5Salad315131 / 51

Expected Output: Notice column [sold_inventory_ratio] >> The ratios are correctly displayed

item_iditemitem_solditem_inventorysold_inventory_ratio
1Pizza155415 / 54
2Burgers54805 / 48
3Tacos124612 / 46
4Sushi14501 / 45
5Salad315131 / 51
1 ACCEPTED SOLUTION
win_anthony
Resolver III
Resolver III

I was able to find a resolution by updating the measure from " / " to " of "

sold_inventory_ratio =
FORMAT(VALUE([item_sold]),"0,0") & " of " & FORMAT(VALUE([item_inventory]),"0,0")

 

View solution in original post

4 REPLIES 4
win_anthony
Resolver III
Resolver III

I was able to find a resolution by updating the measure from " / " to " of "

sold_inventory_ratio =
FORMAT(VALUE([item_sold]),"0,0") & " of " & FORMAT(VALUE([item_inventory]),"0,0")

 

v-jayw-msft
Community Support
Community Support

Hi @win_anthony ,

 

What is the Data Type of this column in Power BI Desktop?

Could you try changing it to Text Type then exporting again?

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

@v-jayw-msft I updated the measure and the data type is now Text. Unfortunately, I am still getting the same result for the data export. The export will result in some values reflected as Dates (just like in the example listed above). 

 

Any advice on how I can remedy this? Your advice is greatly appreciated. 

 

sold_inventory_ratio =
FORMAT(VALUE([item_sold]),"0,0") & " / " & FORMAT(VALUE([item_inventory]),"0,0")

@v-jayw-msft the data type in Power BI Desktop for this measure was General. I tried to update it to Text but for some reason the data type is not changing. Any advice on how I can change the measure data type to Text? 

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.